Skip to content

Instantly share code, notes, and snippets.

@sheeeng
Created November 19, 2013 10:55
Show Gist options
  • Save sheeeng/7543676 to your computer and use it in GitHub Desktop.
Save sheeeng/7543676 to your computer and use it in GitHub Desktop.
if [ $# -gt 0 ]; then
echo "Your command line contains $# arguments."
else
echo "Your command line contains no arguments."
fi
if [ "$1" != "" ]; then
echo "Positional parameter 1 contains something."
else
echo "Positional parameter 1 is empty."
fi
processDirectory="${1:-$PWD}"
echo "The ${processDirectory} directory will be processed."
cd ${processDirectory}
echo "\$PWD is" $PWD "directory."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment