|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a script I want to run only on openSUSE 11.1. So I include this bit of code in the script:
Code:
VERCHECK=`grep 11.1 /etc/SuSE-brand > /dev/null; echo $?` if [ "$VERCHECK" -eq "1" ]; exit 1 fi 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!)? Thanks in advance for any help offered. |
|
|||
|
You could instead look at /etc/SuSE-release which contains this:
Quote:
|
|
|||
|
Wonderful advice. I looked in the /etc directory until my eyes went square... and they obviously did! Thank you for that.
Do you, by any chance, happen to know the contents of the SLES equivalent of that file?? No worries if not: you've already helped alot! |
|
|||
|
Ask in the SLES forum perhaps?
|
|
|||
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 /etc/SuSE-release from SLES 10 SP2 x86_32: ab@mybox0:~> cat /etc/SuSE-release SUSE Linux Enterprise Server 10 (i586) VERSION = 10 PATCHLEVEL = 2 and from SLES 11 x86_64 ab@mybox1:~> cat /etc/SuSE-release SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 0 ab@mybox1:~> cat /etc/SuSE-brand SLES VERSION = 11 CO-BRANDS = SLE openSUSE 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/ iQIcBAEBAgAGBQJKoG2oAAoJEF+XTK08PnB5NT4P/im757CcWfZdi36lHucU6XtG ooGH2ah2hax8UQzlU+lGp0F2ZkdiTBscpJT1jEkTxYXHKZjSzx haUZvu10FRuUzs zb3TIC8JHmFOB2pOGrk5hati2dlXQQ4e+eCRMqIfpSidNISqkH f7VJAJosLx0VZX OZhB61/a8RgNjpz9Y11nI8sj7AtTpJ6BbxkpsP/BUhWikcqLpujdTvuEILObDM40 wql++Z/eq4qNMynPrEb4/WHTSB8wwxed/ZCNA7SRwbUUFiG47QR4y/xeP8SjiFNo lT9NIclr/bDneJjI1LkDoP6rDmwQqdsgrvNaO6kuHQwaeFegrZqBAag63Ej sBkOs XNwvT2RDSmL7kUodFl318eVcNLpNJhjdJj3BbAQZ/sKZzHfHPx+NaAozXGA45M61 dJoc/YtejToWLFG6NJuBBqzE8B+95vzvHnoNd3ntxNFJxN9FJlXJRlW Qknc+BoV6 8q43sNuF0BSxQH7QnSHmgSNQPZlMMw5D+HldgYLoB+f48aRCN9 xJd/W+j3lZ2i+T 7+pWvWBeO44BRe6XjeGm67MnQeG81vOHjT6j3vUNJnOo3mrgoU ndwF1LuVYCfC6O /ccnP4xHdFvplaiawixKtsXKRXsRtG+KNTBmo7Z9dRdpX7yihRd m823WngkbCG7K Bg7UGUs24cJSgEenIZhK =cjNK -----END PGP SIGNATURE----- |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|