コマンドループにbash select
ステートメントを使用しようとしています。 select文の変数は常に空白です。ここでは、問題を示して簡単なスクリプトです:bash selectステートメントのオプションと一致しません
#!/bin/bash
select term in one two exit
do
echo you selected $term
case $term in
one) echo one; break;;
two) echo two; break;;
exit) echo will exit; return;;
esac
done
は、ここで私は、このスクリプトを実行すると何が起こるかです:
$ ./test.sh
1) one
2) two
3) exit
#? one
you selected
#? two
you selected
#? exit
you selected
#? ^D
誰もが私が間違っているかもしれないものを知っていますか?私はMac OS X 10.7.3です。 /bin/bash --version
はGNU bashバージョン3.2.48(1)-wirey(x86_64-apple-darwin11)
ああ、ユーザーエラー:)ありがとう! –