Run script in new terminal

Hi Guys,

I have a script that runs certain simulations in batch mode. I need to schedule some simulations to run over night.
For each simulation to complete it should be run in separate terminal.

My script is as follows

sh run_test.sh <arg1> <arg2> <arg3> ...

I need to launch this command in a separate terminal so I use :

gnome-terminal --window -e "sh run_test.sh <arg1> <arg2> <arg3> ..."

I tried:
gnome-terminal --window -e "sh run_test.sh <arg1> <arg2> <arg3> ..."

But it does not work. The terminal is opened for a fraction of second then close immediately.

Kindly advise.

Thanks

What is the difference between you opening a terminal and run that script, rather than executing the script in the current terminal?

Did you try passing the full path to the script?
Because if it happens to be not in the very same path, it will fail immediatly.

You could still make a file with your args, as:
Arg_File:

arg1 arg2 arg3
arg1 arg2 arg3 arg4
arg1 arg2
arg1 arg2 arg3
arg1 arg2 arg3 arg4
arg1 arg2

Then run something like:

while read line;do
   sh run_text.sh $line
done<Arg_File

hth

You could run all those processes in the background from your current terminal. Don't forget to nohup or disown each of them, lest they're killed when you log off!

Thanks guys.

I tried the xterm instead of terminal and it works. I do not know the reason why the gnome-terminal does not work.

---------- Post updated at 02:52 PM ---------- Previous update was at 02:49 PM ----------

I have a list of simulations that I want to automate them running. Each simulation runs in individual terminal.
I can open a new terminal manually when I'm setting on the machine. But I want to automate the run of the test list over night.

Check out screen

There are examples online, you should be able to run whatever you like multiple times, logging output and everything session spits out in a file (or not)

Hope that helps
Regards
Peasant.

So simply send the command to background using a & .

...
    $SHELL run_text.sh $line &
...

Though that is not recomended if you have more than, lets say, 5-10 scripts/lines, you might bring that machine to its knees spwaning too many subshells.
Search the forum for paralell execution or background jobs, there are several good threads covering the topic with examples.

hth