From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111c93,aa7d2c233b1e4315 X-Google-Attributes: gid111c93,public X-Google-Thread: f9382,aa7d2c233b1e4315 X-Google-Attributes: gidf9382,public X-Google-Thread: 100b1f,aa7d2c233b1e4315 X-Google-Attributes: gid100b1f,public X-Google-Thread: f678e,aa7d2c233b1e4315 X-Google-Attributes: gidf678e,public X-Google-ArrivalTime: 2001-11-22 06:55:35 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.25.12.36!oleane.net!oleane!sncf.fr!not-for-mail From: "Roberto Costa" Newsgroups: comp.os.linux,comp.os.linux.alpha,comp.os.linux.help,it.comp.os.linux.development Subject: Re: facile.. Date: Thu, 22 Nov 2001 15:54:20 +0100 Organization: S.N.C.F. (French Railways) Message-ID: <9tj3l1$j32$1@muguet.sncf.fr> References: <9tglpg$6ip$1@canarie.caspur.it> <13ac9dc9.0111220059.1107972d@posting.google.com> NNTP-Posting-Host: 10.10.153.243 X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.os.linux:12160 comp.os.linux.alpha:4288 comp.os.linux.help:7895 it.comp.os.linux.development:6730 "Davide Lucchesi" a �crit dans le message news: 13ac9dc9.0111220059.1107972d@posting.google.com... > "GiMan" 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