Skip to content

Instantly share code, notes, and snippets.

@PaulChana
Created January 22, 2018 10:43
Show Gist options
  • Save PaulChana/46fe896cf394cc702e08356c3200a2aa to your computer and use it in GitHub Desktop.
Save PaulChana/46fe896cf394cc702e08356c3200a2aa to your computer and use it in GitHub Desktop.
[Bash Defaults] Set variable defaults #shell #bash
#!/bin/bash
FIRST_ARG="${1:-no_first_arg}"
SECOND_ARG="${2:-no_second_arg}"
THIRD_ARG="${3:-no_third_arg}"
echo ${FIRST_ARG}
echo ${SECOND_ARG}
echo ${THIRD_ARG}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment