Quote:
Originally Posted by bluemoon1
However, I failed to make it to check if it is non-zero- tried a few syntax with no luck... such as: if [ ! domything ], if [ domything -ne 0 ].... can you make it?;-)
|
No alas, I haven't. However some programs can reverse the return code, eg grep with the -v option.
There is a program called "true" and one called "false", there should be one called "not"....
Code:
#!/bin/sh
if $@
then
exit 1
fi
exit 0
then you could do
Code:
if not myprogram
then
.....