Last active
March 9, 2017 19:31
-
-
Save var-bin/7d31f3bbd9620ccf464858c77422f997 to your computer and use it in GitHub Desktop.
if elif else example. Repository https://github.com/var-bin/terminalForCoder__WSD
This file contains hidden or 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
#!/bin/bash | |
if [[ -f "$1" ]] | |
then | |
echo "Removing file ${1}" | |
rm "$1" | |
elif [[ -d "$1" ]] | |
then | |
echo "Removing dir ${1}" | |
rm -r "$1" | |
else | |
echo "Can't remove ${1}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment