From: Maxwell Lol on
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
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
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.