Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am very new to linux platform.

Looking for a script file to call different application start up file located in different location and needs to be run in different terminals.

For example :

i have two .sh file like and in different locations.

Now need a script file to run these .sh file. when i run that script it should be open two terminals . In the first terminal should be called and file should be run on second terminal .

Thanks in advance for help.

Regards, Raghu

share|improve this question

That is quite simple. Write a script something like this:

xterm -e /bin/bash /path/to/ &
xterm -e /bin/bash /path/to/ &

The -e option means "execute". The argument after it is the command to execute (here it is /bin/bash) and the next option is the argument for the command (here the name of the script-file). & means that the xterm-commands are running in background. If you remove the first &, it will run the first script completely and afterwards it will start the next command, but as I understood your question you want to run them simultaneously, so leave the & there.

You can also use the standard terminal instead of xterm, but this depends on the distribution and desktop you use. For example in gnome it would be gnome-terminal -x, but it should not make any difference when using xterm.

Hope this helps.

Greatings, Darth Ravage

share|improve this answer
I thought it was gnome-terminal -e (-x seems to work as well, but -e appears in the --help page)... Also, with gnome-terminal, you can get it to hold the terminal open (in preferences, under 'Title & Command'), so you can see the output when the scripts exits. Also, if the scripts being called have the shebang line #!/bin/bash, you shouldn't need to prefix the command /bin/bash (or bash) – Wilf Jul 4 '14 at 9:20
You're perfectly right with the -e. My mistake. I wrote /bin/bash just for the sake of completeness, but as you said it is perfectly possible to just write bash. Thanks for the constructive criticism. – Darth Ravage Jul 4 '14 at 10:35

Your Answer


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.