2015-07-13から1日間の記事一覧
bash の getopts で、同一のオプションが指定されたときの振る舞いを確かめた。 たとえば rsync みたいに -v が重ねられるようだ。 #!/bin/bash VERBOSE="" while getopt v option; do case $option in v) VERBOSE="v${VERBOSE}" ;; esac done shift $(( OPT…
bash の getopts で、同一のオプションが指定されたときの振る舞いを確かめた。 たとえば rsync みたいに -v が重ねられるようだ。 #!/bin/bash VERBOSE="" while getopt v option; do case $option in v) VERBOSE="v${VERBOSE}" ;; esac done shift $(( OPT…