I'm new to Linux, so not sure how to do what I want.
I have my_script.sh
(executable, of course) like this:
#!/usr/bin/env bash
mate-terminal -e "bash -c 'cd /home/my_user/ruby_projects/my_app/';'rails s';exec $SHELL"
NOTE: This script should open terminal, change current directory to the given one in that terminal, start rails application without closing terminal. All these things should be done after booting of the system automatically (now I run this script manually). Script contains a few similar comands, so a few terminals should be opened.
If I open terminal, go to the directory of the script, run ./my_script.sh
- everything works perfectly and exactly how I want it to work, but every time I boot I have to do this manually.
So I went to Control center -> Startup Applications -> Add -> browsed my shell script, gave name -> Add
After that I restarted system and... :( Everything what I see is a few blinks on the screen (that is the opening and closing of mate-terminals) - everything happens so quickly that I can not see what it shows (however, all terminals should remain opened!). And, of course, no rails apps are started. All terminals are closed. How to fix this?
Update:
at first my thought was that not all processes that were needed for rails apps started and that is why terminals simply closed, so I tried ty add sleep 10
for the script to wait till everything boots properly, but that changed nothing - blinking was just delayed by 10 seconds.
mate-terminal
. Please update your Q and describe what you're really trying to accomplish here.$SHELL
here ? Because when I runbash -c "echo $SHELL"
I get zsh :)$SHELL
keeps terminal opened when all previous commands finished executing. And it works this way, when I run script manually. I've triedsleep 10
- but it did not help. Maybe, something is really wrong with $SHELL.