From: Maxwell Lol on 23 Jan 2010 08:07 Robert Latest <boblatest(a)yahoo.com> writes: > Maxwell Lol wrote: >> Robert Latest <boblatest(a)yahoo.com> writes: >> >>> $ cat | read h m ; echo $h $m | Let's pipe stdin through cat >> >> s/cat |// > > You missed the point. My point was that you are doing a useless use of cat (UUOC). Why do $ cat | read h m ; echo $h $m | Let's pipe stdin through cat when you can do $ read h m ; echo $h $m | Let's pipe stdin through cat
From: Janis Papanagnou on 23 Jan 2010 08:31 Maxwell Lol wrote: > Robert Latest <boblatest(a)yahoo.com> writes: > >> Maxwell Lol wrote: >>> Robert Latest <boblatest(a)yahoo.com> writes: >>> >>>> $ cat | read h m ; echo $h $m | Let's pipe stdin through cat >>> s/cat |// >> You missed the point. > > My point was that you are doing a useless use of cat (UUOC). > > Why do > $ cat | read h m ; echo $h $m | Let's pipe stdin through cat > when you can do > $ read h m ; echo $h $m | Let's pipe stdin through cat > To have a pipe involved, and to see bash's behaviour of the last processes in a pipeline being executed in a subshell. The OP originally asked: >>>> In short: Why doesn't 'read' assign any values to >>>> variables h and m when stdin comes in from a pipe? Janis
From: Maxwell Lol on 25 Jan 2010 12:13
Janis Papanagnou <janis_papanagnou(a)hotmail.com> writes: > Maxwell Lol wrote: >> Robert Latest <boblatest(a)yahoo.com> writes: >> >>> Maxwell Lol wrote: >>>> Robert Latest <boblatest(a)yahoo.com> writes: >>>> >>>>> $ cat | read h m ; echo $h $m | Let's pipe stdin through cat >>>> s/cat |// >>> You missed the point. Yes I did. I apologize. |