Created
February 21, 2024 17:26
-
-
Save colematt/fb8763ab5cf22e330659fb11ba35a50a to your computer and use it in GitHub Desktop.
[Determine if a package is installed] #apt #ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check to see if a package named ansible is installed | |
if [ "$(dpkg -l | awk '/ansible/ {print }'|wc -l)" -ge 1 ]; then | |
echo OK | |
else | |
echo FAIL | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment