[plug] problem with script

James Devenish devenish at guild.uwa.edu.au
Mon Aug 25 18:08:52 WST 2003


In message <sf4a511b.067 at mmtnetworks.com.au>
on Mon, Aug 25, 2003 at 06:10:31PM +0800, Jon  Miller wrote:
> MMSTAT=`pgrep -u root mmsmtp.out`
[...]
> if [ "$MMSTAT" -lt 1 ]; then

BTW the above will run pgrep when the variable is declared, not during
the "if" statement. To resolve this, I would use this, instead:

> MMSTAT=(pgrep -u root mmsmtp.out >& /dev/null)
> 
> if $MMSTAT; then

This is for zsh, though. Does anyone know a POSIX equivalent?




More information about the plug mailing list