Shell Help

Fred Youhanaie fly at anydata.co.uk
Mon May 14 16:20:36 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
> 
>     output=`chatty_app`;
>     if [ -z "$!" ]
>     then
>        echo "Erk - failure!";
>        echo "$output";
>     fi

How about a sub-shell to cover the whole lot?

	(output=`...`
	if ...
	...
	fi ) &

You can also redirect to a file, then check size of file, instead of 
$output.



Cheers
f.



More information about the london.pm mailing list