Re: nohup and xargs?



On Sun, 29 Jun 2008 06:58:38 -0700, howa wrote:

Hello,

How to combine nohup and xargs together?

Conside I have a simple perl program, which take a string as input

E.g.

test.pl foo


I have a file contains all the input to be run, so I use xargs,

E.g

cat input.txt | xargs ... test.pl

It run well, but I want to run in background and not affected by ssh
exit,

I tried to use nohup,

E.g.

nohup cat input.txt | xargs ... test.pl

However, when I end the ssh, the program did not continue to run...

any idea?

Thanks.

I believe nohup wants to see a simple command.

You'll probably get what you want by doing something like:

echo 'cat input.txt | xargs ... test.pl" > /tmp/cmd
chmod 755 /tmp/cmd
nohup /tmp/cmd

....or just run it under screen instead of using nohup - that's probably
easier. You can detach from a screen session with ^Ad. Then you can re-
attach later with screen -r, and see what your command did. It should be
sitting there waiting at a command prompt after the command finishes, as
though you'd been connected the whole time.

.



Relevant Pages

  • nohup and xargs?
    ... How to combine nohup and xargs together? ... Conside I have a simple perl program, which take a string as input ... I have a file contains all the input to be run, so I use xargs, ... However, when I end the ssh, the program did not continue to run... ...
    (comp.os.linux.misc)
  • Re: nohup and xargs?
    ... How to combine nohup and xargs together? ... I have a file contains all the input to be run, so I use xargs, ... However, when I end the ssh, the program did not continue to run... ... I believe nohup wants to see a simple command. ...
    (comp.os.linux.misc)
  • Re: nohup and xargs?
    ... How to combine nohup and xargs together? ... I have a file contains all the input to be run, so I use xargs, ... nohup cat input.txt | xargs ... ... However, when I end the ssh, the program did not continue to run... ...
    (comp.os.linux.misc)
  • Re: Q : RunAs under X Window, controlling terminal of an application and sudo
    ... You could use the "nohup" command to insulate the evolution process from ... You probably want to redirect both standard ...
    (alt.os.linux)
  • Re: submit process then exist the shell, the job terminated
    ... second command can not able to run. ... It is frequently desirable to apply nohup to pipelines or lists ...
    (comp.unix.shell)