9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Gregory Pavelcak <g.pavelcak@comcast.net>
To: 9fans@cse.psu.edu
Subject: [9fans] awk script weirdness
Date: Tue, 21 Nov 2006 13:58:10 -0500	[thread overview]
Message-ID: <c8ce9dd8c960869e44a9a78249271cae@comcast.net> (raw)

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



             reply	other threads:[~2006-11-21 18:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-21 18:58 Gregory Pavelcak [this message]
2006-11-21 19:06 ` Sape Mullender
2006-11-21 19:13   ` Gregory Pavelcak
2006-11-21 21:19 ` Victor Nazarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8ce9dd8c960869e44a9a78249271cae@comcast.net \
    --to=g.pavelcak@comcast.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).