Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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 )&
share|improve this answer
    
Unfortunately, that didn't help. The console still hangs. Any more ideas? –  mreq Mar 30 '13 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 '13 at 13:31
    
thanks for help, I'll give it a try once I get some time and will inform you –  mreq Apr 1 '13 at 14:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.