[TUHS] redirection wildness in v7

Will Senn will.senn at gmail.com
Fri Nov 10 01:38:03 AEST 2017


Hi Ralph,

This is a good answer. I thought it was great until I saw Dan's :).

I didn't realize that the open group standard was online and accessible. 
Thanks for the link.

Will

On 11/09/2017 09:04 AM, Ralph Corderoy wrote:
> Hi Will,
>
>> Why does the first of these incantations not present text, but the
>> second does (word is a file)? Neither errors out.
>>
>> $ <word | sed 20q
>> $ <word sed 20q
> That's still the case with modern-day sh(1).
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01
> explains that a simple command doesn't need to result in a command name
> to execute.  In your first pipeline, there's nothing to copy the data
> from the first subshell's stdin redirected from ./word to the subshell's
> stdout that's pipes into sed's stdin.  Adding a command to do the copy
> works.
>
>      <word cat | sed 20q
>



More information about the TUHS mailing list