Skip to content

Instantly share code, notes, and snippets.

@marioplumbarius
Created September 14, 2013 00:45
Show Gist options
  • Save marioplumbarius/6557777 to your computer and use it in GitHub Desktop.
Save marioplumbarius/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