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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -