stuart at sjsears.com
Fri Apr 7 11:37:41 UTC 2006
-----BEGIN PGP SIGNED MESSAGE-----
Dan Track wrote:
> On 4/7/06, Paul Howarth <paul at city-fan.org> wrote:
>> Dan Track wrote:
>>> Simple question, I'm running a command `command`, what I'd like to do
>>> is check to see if the response is empty then exit. Does anyone know
>>> how I can perform that check?
>> Exit if "command" produces no output:
>> [ -z "$(command)" ] && exit
> Incidentally. What do you have $() instead of just ().
$(command) == `command`
otherwise you would be testing the length of the literal string '(command)'
this way we are running command and testing the length of its output.
Stuart Sears RHCA RHCX
To err is human, to forgive is Not Company Policy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v22.214.171.124 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the users