On Mon, 2004-10-18 at 16:33, Brian Henning wrote:
> <omitting much of the context due to OE attaching PGP messages as text
> attachments and me being lazy>
> All my shell scripts start with #!/bin/bash ..  so there's that idea out the
> window..  Er.. OLF?  Out in Left Field?  heh..
> 
> I would've used killall to automatically find the process, had suspend
> actually suspended..

Well, it looks like we're making this harder than necessary.  The
following script seems to work for me; instead of using suspend, I just
sent the STOP signal to the script itself.

(script is called "test.sh")

#!/bin/bash
 
echo "this is a script"
kill -STOP $$
echo "script has resumed"

then, running the script, and then resuming it, works as desired:

$ ./test.sh | cat &
[1] 31359
$ this is a script
$
$ killall -CONT test.sh
$ script has
resumed                                                                           
[1]+  Done                    ./test.sh | cat

Obviously the prompts are mixed in there with the output from the script
itself, but you get the point.  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.)

Hope this helps,
Jeremy

-- 
/---------------------------------------------------------------------\
| Jeremy Portzer        [EMAIL PROTECTED]      trilug.org/~jeremy     |
| GPG Fingerprint: 712D 77C7 AB2D 2130 989F  E135 6F9F F7BC CC1A 7B92 |
\---------------------------------------------------------------------/

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc

Reply via email to