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

Re: Appreciate advice on %if %foo || %bar syntax



In regard to: Re: Appreciate advice on %if %foo || %bar syntax, Tony...:

%define is_rhel5 %(test -f /etc/redhat-release && cat /etc/redhat-release | egrep -q 'release 5' && echo 1 || echo 0)

Thanks from somebody else :)

Quite another thing is, that a more rational test would be something like:

"test -f /etc/redhat-release && grep 'release 5' /etc/redhat-release &&
echo 1 || echo 0"

Except you probably want the -q option to grep, otherwise your macro might
end up resulting in

	release 51

Getting rid of the useless cat was a good move, but I don't see any reason
to prefer grep over egrep here.

Tim
--
Tim Mooney                              mooney dogbert cc ndsu NoDak edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164


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