Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* facile..
@ 2001-11-21 16:43 GiMan
  2001-11-22  8:59 ` facile Davide Lucchesi
  0 siblings, 1 reply; 3+ messages in thread
From: GiMan @ 2001-11-21 16:43 UTC (permalink / raw)


ciao tutti..
come faccio a eliminare le ultime tre righe da tutto un gruppo di files?
vorrei usare sed, o awk..
grazie
ciao
Giorgio




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: facile..
  2001-11-21 16:43 facile GiMan
@ 2001-11-22  8:59 ` Davide Lucchesi
  2001-11-22 14:54   ` facile Roberto Costa
  0 siblings, 1 reply; 3+ messages in thread
From: Davide Lucchesi @ 2001-11-22  8:59 UTC (permalink / raw)


"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

--
Dave


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: facile..
  2001-11-22  8:59 ` facile Davide Lucchesi
@ 2001-11-22 14:54   ` Roberto Costa
  0 siblings, 0 replies; 3+ messages in thread
From: Roberto Costa @ 2001-11-22 14:54 UTC (permalink / raw)


[-- 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-11-22 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-21 16:43 facile GiMan
2001-11-22  8:59 ` facile Davide Lucchesi
2001-11-22 14:54   ` facile Roberto Costa

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