ash_cpan at firemirror.com
Mon May 14 21:48:58 BST 2007
Simon Wistow wrote:
> In a shell script I'm launching an app which is particularly chatty and
> wants to spew a load of stuff to the command line as it starts up.
> Unfortunately it also spews its error messages to stdout WHICH MAKES
> SIMON ANGRY.
> My solution is
> if [ -z "$!" ]
> echo "Erk - failure!";
> echo "$output";
> And all is well and good. The problem is that chatty_app also doesn't
> background itself but putting
> output=`chatty_app &`;
> doesn't work i.e it never gets to the test so non of the other stuff I
> want running (which must run after chatty_app) works.
> Anybody got any ideas?
./blah.sh > foo.$$ &
output=$(cat foo.$$) && rm foo.$$
echo output is $output
Where blah.sh for testing was:
echo "Blah blah blah"
echo "Bad app - no cookie"
More information about the london.pm