Skip to content

Instantly share code, notes, and snippets.

@ATMartin
Last active August 30, 2019 02:33
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 ATMartin/18dc07b9063e27e88f14216375045e17 to your computer and use it in GitHub Desktop.
Save ATMartin/18dc07b9063e27e88f14216375045e17 to your computer and use it in GitHub Desktop.
#!/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