Skip to content

Instantly share code, notes, and snippets.

@jrosco
Created June 7, 2017 20:59
Show Gist options
  • Save jrosco/e6866e46d4bd37e11ff712cf059680cd to your computer and use it in GitHub Desktop.
Save jrosco/e6866e46d4bd37e11ff712cf059680cd to your computer and use it in GitHub Desktop.
Bash use default cmd args
#!/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