I have a script I want to run only on openSUSE 11.1. So I include this bit of code in the script:
VERCHECK=`grep 11.1 /etc/SuSE-brand > /dev/null; echo $?`
if "$VERCHECK" -eq "1" ];
exit 1
fi
…so the script exits if the string “11.1” is NOT found in that file.
Two questions. The SUSE-brand file actually contains the contents
openSUSE
VERSION = 11.1
How would one go about checking for both lines in a single test. I know, in other words that I could grep for “openSUSE” and then, if that succeeds, nest another grep for “11.1”. But if I didn’t want to nest grep tests?
Secondly, and a bit cheekily I realise, but what are the exact contents of the equivalent file on Suse Enterprise Linux, please (if anyone here knows, of course!)?
But yes, this is a good question for the SLES forums specifically in the
future.
Good luck.
ken yap wrote:
> Ask in the SLES forum perhaps?
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/