I have this script named wsjs.sh
:
#!/bin/bash
WS=/home/user/wsjs
cd $WS
nohup atom . &
gnome-terminal
grunt watch
If I run it in bash:
./wsjs.sh
Then atom editor, gnome-terminal are started separately, and the current bash showing:
user@ubuntu:~$ ./wsjs.pwd
nohup: appending output to ‘nohup.out’
Running "watch" task
Waiting...
Now if I press ctrl + c
, grunt watch
quits, BUT atom editor is also closed.
...this is weird.
I manually entered every command in bash, and atom was NOT closed. I replaced atom with gedit and run the script, it was NOT closed.
Why was atom closed ? Thanks!