[CentOS] Helper variables like %{rhel} on CentOS

Akemi Yagi amyagi at gmail.com
Wed Jan 5 18:07:22 UTC 2011


On Tue, Jan 4, 2011 at 4:38 PM, Nico Kadel-Garcia <nkadel at gmail.com> wrote:

> Hmmm.. You might befit from the portability of this approach
>
> %rhel           0%(/bin/rpm -q --f /etc/redhat-release -qf '%{VERSION}\n' )
>
> Notice that this now works with RHEL and CentOS, and the "\n" keeps
> certain programs historically happier with the commands having an EOL.

Nice. Minor corrections  needed:

-f => --f
-qf => --qf

Akemi



More information about the CentOS mailing list