linux - How to detect if my server is running centos or other from a perl script -
i want display text in script if operating system centos . how can in perl script ?
to answer exact question, can identify centos reading contents of /etc/redhat-release
. e.g.
$ cat /etc/redhat-release centos release 5.9 (final)
as other commenters have made clear, better depend on exact os features want, or write code portable, rather limiting particular distribution of linux.
Comments
Post a Comment