From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <45636D78.5090501@comtv.ru> Date: Wed, 22 Nov 2006 00:19:52 +0300 From: Victor Nazarov User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] awk script weirdness References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: e5a38d78-ead1-11e9-9d60-3106f5b1d025 Gregory Pavelcak wrote: >I've been trying to break a large .ms-like file into smaller >files with awk with variations on the following script > >awk ' > BEGIN {i=0} > /^\.([lp]p|hd|xm\/)/ {print >> ++i; next} > {print >> i} >' ../indis.ms > >Whatever I do, it will work fine creating the first 85 files >then quit. > > [snip] > >Any ideas? > > awk ' BEGIN {i=0} /^\.([lp]p|hd|xm\/)/ {close i; i++; print >> i; next} {print >> i} ' ../indis.ms