0
我的問題是當我從/dev/fd/3
與cat
讀取bash文件將掛起。我希望有一種方法可以從後臺的文件描述符中讀取,這樣我就可以繼續執行其餘的shell代碼。如何從shell腳本的後臺讀取文件描述符
#hangs here. pipe file descriptor 3 to yummy-stdin.pl
cat /dev/fd/3 | yummy-stdin.pl
./this-shall-never-run.pl
我已經試過:
cat /dev/fd/3 | yummy-stdin.pl & this-shall-never-run.pl;
的問題與上面,而它的處理this-shall-never-run.pl,它將停止從文件描述符讀取。完成後,它將繼續閱讀......但這不是我想要的。
如果我使用'貓的/ dev/FD/3> my_pipe'不會只是掛在那裏?我沒有看到解決我的問題 – AustinAllover 2013-02-15 02:45:48
你如何給貓的fd 3添加一個流?您通常會使用'... 3
2013-02-15 06:13:48
@StevenPenny這不是一個重複的http://stackoverflow.com/q/12667621/mkfifo-causes-terminal-tohanghang – Celada 2013-02-15 15:19:16