Skip to content

Instantly share code, notes, and snippets.

@marioluan
Created September 14, 2013 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marioluan/6557777 to your computer and use it in GitHub Desktop.
Save marioluan/6557777 to your computer and use it in GitHub Desktop.
Shell scripts to check if certain dpkg packages are installed on linux systems.
#!/bin/bash
## npm
is_npm_installed=$(dpkg -l | grep -i npm | awk '{print $2}')
if [ '$is_npm_installed' == 'npm' ]
then
is_npm_installed=true
else
is_npm_installed=false
fi
echo npm is installed $is_npm_installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment