2020-10-07から1日間の記事一覧

bash tips

bash デフォルト値 #!/bin/bash foo=${1:-hoge} echo $foo #$1がなかったらhogeをデフォルト値としてfooに代入する https://gist.github.com/doi-t/7853853 bash ループ items[0]="altair" items[1]="betelgeuse" items[2]="canopus" for item in "${items[@…

bash デフォルト値

#!/bin/bash foo=${1:-hoge} echo $foo #$1がなかったらhogeをデフォルト値としてfooに代入する https://gist.github.com/doi-t/7853853