【发布时间】:2011-02-10 05:26:52
【问题描述】:
我有类似的 shell 脚本 -
while read -r line;
do
echo $line
done < file.txt
这很好,但我需要在从文件中读取每一行后提示用户输入。 我尝试添加“读取”,但这不起作用。
while read -r line;
do
echo $line
#prompt user here
read input_user
done < file.txt
有什么想法吗?我也愿意使用 awk。
【问题讨论】:
-
谢谢大家..你的答案工作正常..现在我很困惑选择(打勾)哪个答案:D ..
-
while后面不需要分号。