bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: it seems that variables red by builtin function "read" are modified


From: Andreas Schwab
Subject: Re: it seems that variables red by builtin function "read" are modified (or ignored) during execution
Date: Thu, 26 Apr 2007 18:27:36 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.97 (gnu/linux)

Jean-Philippe Ayanides <jp.ayanides@free.fr> writes:

> Here is the script :
> --------------------------------
> #!/bin/bash
>
> temp=/tmp/file.$$
> cat > $temp << EOF
> 00000000 00000 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> 12345678 01234 6789012345678901234567890123456789012345678901234
> 12345678 01234 6789012345678901234567890123456789012345678901234
> 12345678 01234 6789012345678901234567890123456789012345678901234
> 12345678 01234 6789012345678901234567890123456789012345678901 abcd
> 12345678 01234 6789012345678901234567890123456789012345678901234
> 12345678 01234 6789012345678901234567890123456789012345678901234
> 12345678 01234 6789012345678901234567890123456789012345678901234
> 12345678 01234 6789012345678901234567890123456789012345678901 efghi
> EOF
>
> cat $temp | ( while read data;
>               do
>               echo "data=$data"
>               mplayer "inexistant-file.avi"  2>/dev/null 1>&2

Most likely mplayer is reading from stdin.  You should redirect its input
to avoid that.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]