Bash shell read error: 0: Resource temporarily unavailable

后端 未结 6 2061
感情败类
感情败类 2021-02-07 23:54

When writing a bash script. Sometimes you are running a command which opens up another program such as npm, composer.. etc. But at the same time you need to use read

6条回答
  •  再見小時候
    2021-02-08 00:31

    When this happens, run bash from within your bash shell, then exit it (thus returning to the original bash shell). I found a mention of this trick in https://github.com/fish-shell/fish-shell/issues/176 and it worked for me, seems like bash restores the STDIN state. Example:

    bash> do something that exhibits the STDIN problem
    bash> bash
    bash> exit
    bash> repeat something: STDIN problem fixed
    

提交回复
热议问题