[TriLUG] Making a bg'd bash script wait for user intervention
Brian Henning
brian at strutmasters.com
Tue Oct 19 08:30:24 EDT 2004
Jeremy,
This (kill -STOP $$) looks very promising. You've got me though on this
little [trivial?] bit:
> I piped the script's output to cat so that the shell saw
> that the output was being redirected to a pipe, rather
> than a tty, which affects how this works. (Try it both
> ways and you'll see how.)
Well, I did try it both ways (using your sample script), and the only
difference I saw was whether or not the "[job]+ Stopped <command>"
appeared on the console (presumably because in the | cat instance, the shell
believes it should get its stdout and stderr from cat, rather than from the
script, so the script's stderr goes into oblivion). Is that the only
difference, or is there another fundamental I should be gleaning from this?
Thanks a lot!
~Brian
More information about the TriLUG
mailing list