have been trying to figure out a different solution then using the
> > -i arg. Is there a simple way to just open each file, delete the 5
> > lines in place and close it(with no backup file), without getting
> > into sysread, truncate, etc...
> 
> Not really. What's the problem with using -i?

nothing really, just curiosity

>
> > 
> > cd dir_with_the_files
> > for file in `ls .`
> > do
> >         sed '1,5d' $file > $file
> > done
> 
> Really? did you actually try that? The shell will clobber the 
> file before
> sed gets a chance to open it. I don't see how you could wind up with
> anything but an empty file.

oops, you are correct, should be:
sed '1,5d' $file > $file.new

but we still have not changed the original file, have we :-)

Thanks
Jim


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to