Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: "Roberto Costa" <dsdgfdg@fhfh.fr>
Subject: Re: facile..
Date: Thu, 22 Nov 2001 15:54:20 +0100	[thread overview]
Message-ID: <9tj3l1$j32$1@muguet.sncf.fr> (raw)
In-Reply-To: 13ac9dc9.0111220059.1107972d@posting.google.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

"Davide Lucchesi" <davide@lucchesi.eu.org> a �crit dans le message news:
13ac9dc9.0111220059.1107972d@posting.google.com...
> "GiMan" <giomen2000_NOSPAM@iol.it> wrote in message
news:<9tglpg$6ip$1@canarie.caspur.it>...
> > ciao tutti..
> > come faccio a eliminare le ultime tre righe da tutto un gruppo di files?
> > vorrei usare sed, o awk..
>
> Ci sono sicuramente delle soluzioni piu' efficienti, ma questa e'
> particolarmente divertente...
>
> for i in ELENCO DEI FILE; do
>     head -$(( `wc -l $i | awk '{print $1}'` - 3 )) $i > $i.new
>     mv $i.new $i
> done

Why don't you use the following?

for i in LIST OF FILES; do
  tail -3 $i > $i.new
  mv $i.new $i
done

However I agree this is much less funny than using sed or awk. :-)

Roberto





      reply	other threads:[~2001-11-22 14:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-21 16:43 facile GiMan
2001-11-22  8:59 ` facile Davide Lucchesi
2001-11-22 14:54   ` Roberto Costa [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox