Glen Turner <[email protected]> writes:
> On 16/06/09 22:06, david wrote:
>> Q1.why does sed lose the first line?
>> cat blah | while read line ; do sed s/t/T/ ; done
>
> Think about the return value of sed with no input. while swallows the first
> line, then cat prints the rest.

Not quite; read captures the first line, sed processes the rest.  Otherwise
spot on, though, especially ...

[...]

> I don't understand why you didn't choose a direct file redirection
> rather than a pipe: sed s/t/T/ < blah

... that. ;)

Regards,
        Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to