osx - Why does "read -t" block in scripts launched from xcodebuild? -
I have a script that creates a FIFA and launches a program that writes the output to FIFO. Until reading out of the program, I read and parse the output.
MYFIFO = / tmp / myfifo $$ mkfifo "$ MYFIFO" MYFD = 3 eval "exec $ MYFD & lt; & gt; $ MYFIFO" external_programm " And "$ MYFD" 2 & gt; And "$ MYFD" & amp; EXT_PID = $! While kill -0 "$ EXT_PID"; Read-t1 line and lt; & Amp; "$ MYFD" # $ Made with LINE This program is still running, while this fine reading input works, but it looks like timeout reads Is not paid attention, and after hanging out of the external program the call is hanging.
I have used successfully reading from other scripts from time to time, and a simple test script which exits the external program time out correctly, what am I doing wrong here?
EDIT: It seems that the read -t function is expected when I run my script from the command line, but when I run it as part of a Xcodebuild creation process, timeout does not work. What is different about these two environments?
I do not think that -t will work with redirection. From the man page:
-t timetable> Read from time to time and return the failure if the full line of input is not read in the timeout seconds This option has no effect if not reading input from read terminal or pipe .
Comments
Post a Comment