| Summary: | /bin/sh 'while read X' loop problem | ||
|---|---|---|---|
| Product: | Base System | Reporter: | root <root> |
| Component: | bin | Assignee: | Jilles Tjoelker <jilles> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 9.1-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
root
2013-04-06 21:40:00 UTC
At Sat, 6 Apr 2013 11:32:24 -0900 (AKST),
Joe Public wrote:
> OK: while read X; do echo $X; done < FILEWITHMP3PATHNAMES
> OK: while read X; do ls -l $X; done < FILEWITHMP3PATHNAMES
> FAIL: while read X; do mplayer $X; done < FILEWITHMP3PATHNAMES
The first iteration of mplayer eats up all stdin.
You can
while read X; do mplayer $X < /dev/tty; done
This is not a bug at all.
--
kuro
State Changed From-To: open->closed As described by kuro, this is not a bug. The mplayer reads from stdin, so that 'read' misses data. Try: while read X <&3; do mplayer $X; done 3<FILEWITHMP3PATHNAMES Responsible Changed From-To: freebsd-bugs->jilles Track replies. |