How to read from user within while-loop read line?

后端 未结 3 1154
清歌不尽
清歌不尽 2020-12-10 08:35

I had a bash file which prompted the user for some parameters and used defaults if nothing was given. The script then went on to perform some other commands with the paramet

3条回答
  •  青春惊慌失措
    2020-12-10 09:06

    To read directly from the terminal, not from stdin (assuming you're on a *NIX machine, not a Windows machine):

    while read foo"
    done
    

提交回复
热议问题