On Fri, 29 Nov 2002, Ramprasad A Padmanabhan wrote:

> 
> Hello all
> 
> I am using redhat linux 7.2
> 
> I am required to delete the last line of a file. Now I am doing a
> cumbersome thing like this
> 
> perl -e '@_=<>;pop @_;print @_;' $FILE > $FILE.tmp
> mv $FILE.tmpl $FILE
> 
> Cant I do it any better

perl -i.tmp -pe 'eof and undef $_' $FILE

perldoc -f eof
perldoc perlrun



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

Reply via email to