9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] awk script weirdness
@ 2006-11-21 18:58 Gregory Pavelcak
  2006-11-21 19:06 ` Sape Mullender
  2006-11-21 21:19 ` Victor Nazarov
  0 siblings, 2 replies; 4+ messages in thread
From: Gregory Pavelcak @ 2006-11-21 18:58 UTC (permalink / raw)
  To: 9fans

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.

The above script quits with

awk: can't open file d�\x04
 input record ../indis.ms:830
 source line 3

While

awk '
	BEGIN	{i=0}
	/^\.([lp]p|hd|xm\/)/	{i=i+1; print >> i; next}
			{print >> i}
' ../indis.ms

quits with:

awk: can't open file D\x04\x06
 input record ../indis.ms:830
 source line 3

Any ideas?

Greg



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

end of thread, other threads:[~2006-11-21 21:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-21 18:58 [9fans] awk script weirdness Gregory Pavelcak
2006-11-21 19:06 ` Sape Mullender
2006-11-21 19:13   ` Gregory Pavelcak
2006-11-21 21:19 ` Victor Nazarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).