0
ユーザー入力を収集して後でテキストファイルに追加するシェルスクリプトを作成しようとしています。 は、ここに私が働いているものです:ファイルに追加する変数へのユーザー入力のコレクション
note_file=~/project_2/file
loop_test=y
while test "$loop_test" = "y"
do
clear
tput cup 1 4; echo " Note Sheet Addition "
tput cup 2 4; echo "============================="
tput cup 4 4; echo "Note: "
tput cup 5 4; echo "Add Another? (Y)es or (Q)uit: "
tput cup 4 10; read note
if test $note = "q"
then
clear; exit
fi
if test "$note" != ""
then
echo "$note:" >> $note_file
fi
tput cup 5 33; read hoop_test
if [ "$hoop_test" = "q" ]
then
clear; exit
fi
done
今私の問題は、私はノート変数だけではなく、単一のarguementに文全体を保存したいということです。 すなわち音符=
明らかhoop
loop
スペルの問題以外に
私はあなたが何を意味するかわからないんだけど: 'note'フルラインがスペースを含む単一の文字列、すなわち、として入力され続ける読んでいないのですか? – Evert
'read loop_test'の代わりに明白な' read hoop_test'以外のもの –