parallel bash scripts

suvayu ali fatkasuvayu+linux at gmail.com
Wed Mar 28 00:57:21 UTC 2012


On Wed, Mar 28, 2012 at 01:06, bruce <badouglas at gmail.com> wrote:
> but the script is a long running script, and i want to see the output
> as the script is running without having to hit the keyboard..

I'm not sure what you mean. Do you mean to say you want to run the
script and start seeing the output with the same command? If that is
the case, there are several solutions. I usually use these two:

$ nohup myscript &> myscript.log & less +F myscript.log
$ nohup myscript 2>&1 | tee myscript.log

If you actually want to run both scripts in the same shell and want to
follow both outputs, try the following variation of the first command:

$ nohup myscript1 &> myscript1.log & nohup myscript2 &> myscript2.log
& less +F myscript1.log myscript2.log

Then you can stop following the first log by hitting Ctrl+c and move
on to the next file with :n you can then start following with F. You
can go back again by repeating the same except change :n to :p.

Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.


More information about the users mailing list