Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

get OS name from lsb-release

if [ -f /etc/os-release ]; then
    # freedesktop.org and systemd
    . /etc/os-release
    OS=$NAME
    VER=$VERSION_ID
elif type lsb_release >/dev/null 2>&1; then
    # linuxbase.org
    OS=$(lsb_release -si)
    VER=$(lsb_release -sr)
elif [ -f /etc/lsb-release ]; then
    # For some versions of Debian/Ubuntu without lsb_release command
    . /etc/lsb-release
    OS=$DISTRIB_ID
    VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
    # Older Debian/Ubuntu/etc.
    OS=Debian
    VER=$(cat /etc/debian_version)
elif [ -f /etc/SuSe-release ]; then
    # Older SuSE/etc.
    ...
elif [ -f /etc/redhat-release ]; then
    # Older Red Hat, CentOS, etc.
    ...
else
    # Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
    OS=$(uname -s)
    VER=$(uname -r)
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: yes/no maybe 
Shell :: arangodb arangodump backup 
Shell :: centos 8 gui 2 
Shell :: cpanel install jpegoptim 
Shell :: shell script to set a max size of log file (laravel) 
Shell :: matplotlib change he yticks to two number after digit 
Shell :: hadoop distcp diff snapshot 
Shell :: /var/spool/cron/: mkstemp: Permission denied 
Shell :: cosmicjs 
Shell :: whats up with docker compose and orphan containers 
Shell :: wtmp is not readable 
Shell :: install onedrive in ubuntu 18.04 
Shell :: on in get first two digit start with two numbers c# 
Shell :: libexpat fedora 
Shell :: batch start file with default program but wait 
Shell :: install amazon-linux-extras 
Shell :: Installation Command 
Shell :: youtube-dl Geo Restriction: 
Shell :: open folder with cli 
Shell :: multiple mount path docker container 
Shell :: inspect changes after git fetch 
Shell :: how to debug istio 
Shell :: docker run -e 
Shell :: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.ccc.notification signatures do not match previously installed version; ignoring!] 
Shell :: pipe list to rm ubuntu 
Shell :: what is 127 of echo $? 
Shell :: bitcoind-sv linux 
Shell :: Bash command to find the highest PID in your system 
Shell :: powershell interactive menu 
Shell :: pcmanfm resycle bin 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =