Last active
August 30, 2019 02:33
-
-
Save ATMartin/18dc07b9063e27e88f14216375045e17 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
ROOTPATH=~/mysh/ | |
TARGETPATH=$ROOTPATH$1 | |
if [ -d "$TARGETPATH" ]; then | |
echo "Listing contents of $TARGETPATH..." | |
ls -al $TARGETPATH | |
elif [ -f "$TARGETPATH" ]; then | |
echo "$TARGETPATH is a file! Unable to list contents." | |
else | |
echo "Unable to find $TARGETPATH! Does it exist?" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment