skip to Main Content

Get Ubuntu version number only with bash – Debian

I execute command cat /etc/os-release in order to get info like NAME="Ubuntu" VERSION="18.04 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic I want to get only 18.04 from VERSION_ID I tried like cat…

VIEW QUESTION

subprocess.check_output() : bash command not found when setting parm executable='/bin/bash' – CentOS

I'm running Python 3.6 on an Centos box. Here's my non-working code shell_command = subprocess.check_output(["ll"],shell=True, universal_newlines=True, executable='/bin/bash') Here's the output: /bin/bash: ll: command not found Traceback (most recent call last): File "./snmp_test.py", line 17, in <module> shell_command = subprocess.check_output(["ll"],shell=True, universal_newlines=True,…

VIEW QUESTION
Back To Top
Search