Re: Bash Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dan Track wrote:
> On 4/7/06, Paul Howarth <paul@xxxxxxxxxxxx> wrote:
>> Dan Track wrote:
>>> Hi
>>>
>>> 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
>>
>> Paul.
> 
> Hi
> 
> 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.

Regards

Stuart
- --
Stuart Sears RHCA RHCX
To err is human, to forgive is Not Company Policy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFENk8FamPtx1brPQ4RAg8EAJ4tJ6fs9ERTtfiCXioEj2BtjPtXtwCfdtky
X0WOLiS8Ec4NbR0hiYkKu9c=
=HpYj
-----END PGP SIGNATURE-----


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux