Ramprasad A Padmanabhan wrote:
> 
> Hello all

Hello,

> 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

Here is one way to do it.  :-)

perl -MTie::File -e'tie @file,"Tie::File",shift;pop @file' $FILE



John
-- 
use Perl;
program
fulfillment

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

Reply via email to