[TriLUG] Making a bg'd bash script wait for user intervention

Ryan Leathers Ryan.Leathers at globalknowledge.com
Mon Oct 18 15:41:59 EDT 2004


have you tried "read" ? ? don't know if backgrounding it will cause troubles
but I'll bet you could test it easily enough.  basically read will just wait
until you press enter.  the variable you set is of no consequence.
 
-----Original Message-----
From: Brian Henning [mailto:brian at strutmasters.com]
Sent: Monday, October 18, 2004 3:10 PM
To: TriLUG
Subject: [TriLUG] Making a bg'd bash script wait for user intervention


Hi Y'all,
  I'm working on a set of scripts for backups, and I've hit a snag in a
script that burns images to CDs.  I need it to wait for user intervention in
certain situations (no CD in drive, CD not blank, swap CDs now, etc).  I've
got the various conditions mapped out in the script; all I need is a way to
make it wait for me to say "go", basically.  The trick is that the process
may be backgrounded, so it can't be simply waiting for Enter on stdin (or
can it?).  I tried suspend, but I get
suspend: cannot suspend: no job control

Is there another simple method to make a bash script wait for a signal?  Or
else, what do I need to do to make suspend work?

Thanks muchly,
~Brian

----------------
Brian A. Henning
Strutmasters.com
866.597.2397
----------------


-- 
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



More information about the TriLUG mailing list