Skip to content

Instantly share code, notes, and snippets.

@fhuitelec
Created November 25, 2017 23:48
Show Gist options
  • Save fhuitelec/acccb30398879102d0a94447a81264cf to your computer and use it in GitHub Desktop.
Save fhuitelec/acccb30398879102d0a94447a81264cf to your computer and use it in GitHub Desktop.
[Check argument is provided] #zsh #cheatsheet
#!/usr/bin/env zsh
#
# Check argument is provided
#
if [ -n "$1" ]; then
echo "Command must have one argument" >&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment