Skip to content

Instantly share code, notes, and snippets.

@ishiy1993
Created February 27, 2016 02:25
Show Gist options
  • Save ishiy1993/0fdf93d081bd731ee5a3 to your computer and use it in GitHub Desktop.
Save ishiy1993/0fdf93d081bd731ee5a3 to your computer and use it in GitHub Desktop.
bashの変数展開の活用。変数が空の場合の処理。
#!/bin/bash
arg1=${1:?Need arguments}
arg2=${2:-!!!}
echo Hello ${arg1}${arg2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment