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

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -