Re: while /usr/bin/read

Re: while /usr/bin/read

am 30.03.2008 18:49:29 von Chris Mattern

On 2008-03-29, Barry Margolin wrote:
> In article
>,
> Edward Rosten wrote:
>
>> On Mar 28, 3:10 pm, More.Sawd...@gmail.com wrote:
>> > Re: ksh on HP-UX 11.23:
>> >
>> > Why does this work....
>> >
>> > while read var1 var2 var3...
>> > do
>> > done < inputfile
>> >
>> > and this doesn't?
>> >
>> > while /usr/bin/read var1 var2 var3...
>> > do
>> > done < inputfile
>>
>>
>> Read is a shell builtin, not an external command. It has to be
>> internal because an external command can't set variables in the
>> context of the calling process (the shell).
>
> Which, of course, leads to the next question: why is there a
> /usr/bin/read command, if it doesn't work?
>
> I believe the answer is that POSIX has a silly requirement that every
> shell built-in have a corresponding external command.
>
Yep, there is. Even more surreal than /usr/bin/read is /usr/bin/cd.


--
Christopher Mattern

NOTICE
Thank you for noticing this new notice
Your noticing it has been noted
And will be reported to the authorities