shell script error

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

 



I hope this is the right list to ask this on.  I am creating a shell script
for something and the following line (whether run from the script or the
command line) gives me an error:
if [ ! -z /bin/cat /tmp/BACKUP/tmp | /bin/grep 'not accepted' ] ; then echo
hi; else echo no; fi

Gives me the following error
-------------
-bash: [: missing `]'
grep: ]: No such file or directory
no
-------------

If I run the command like the following, it works just fine:
/bin/cat /tmp/BACKUP/tmp | /bin/grep 'not accepted'

Any help would be appreciated.

Thanks
Steve

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux