1

I have a simple app launcher script used to open a few apps in a ceratain folder on a certain workspace:

#!/bin/bash
if [[ -n "$2" ]] 
    then
        wmctrl -s $2
fi

terminator --working-directory=$1 &
subl $1 &
smartgithg.sh $1 &
chromium-browser &

when I run it:

petr@sova:~$ open_project work/dyme/ 4
petr@sova:~$ #### some message or whatever
#### the console hangs here, and I need to <ctrl>+c in order to use it again

How do I "escape" from the command and maintain a regular console prompt.

1 Answer 1

1

If you'd like to for off subshells you can use the builtin

()

special characters to do so. To run them in the background use your

&

You can read more about subshells here : Subshells at TLDP Advanced Bash Scripting Guide

This would lead to

#!/bin/bash
if [[ -n "$2" ]] 
    then
         wmctrl -s $2
fi

(terminator --working-directory=$1) &
(subl $1 )&
(smartgithg.sh $1 )&
(chromium-browser )&
3
  • Unfortunately, that didn't help. The console still hangs. Any more ideas?
    – mreq
    Mar 30, 2013 at 20:35
  • Yes. It'll help if you tell me if can you tell which command it hangs on ? For instance, does it show the chromium browser before hanging ? To be thorough with testing this. Append a final line to the script echo "Return to Shell"
    – OYRM
    Apr 1, 2013 at 13:31
  • thanks for help, I'll give it a try once I get some time and will inform you
    – mreq
    Apr 1, 2013 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .