Created
June 7, 2017 20:59
-
-
Save jrosco/e6866e46d4bd37e11ff712cf059680cd to your computer and use it in GitHub Desktop.
Bash use default cmd args
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/bash | |
set -e | |
ARG_ONE=${1:-ONE} | |
ARG_TWO=${2:-TWO} | |
ARG_THREE=${3:-THREE} | |
echo "1:${ARG_ONE} - 2:${ARG_TWO} - 3:${ARG_THREE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment