zsh-users
 help / color / mirror / code / Atom feed
* csplit: 100 file limit reached at arg {9999}
@ 1998-05-02 21:40 Sweth Chandramouli
  1998-05-03  4:08 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Sweth Chandramouli @ 1998-05-02 21:40 UTC (permalink / raw)
  To: ZSH Users

	i'm trying to write a script to convert pegasus mail-style
mailboxes into the normal unix mbox format, and am having a few problems,
at least one of which i think is shell-related.  i want to use formail to
reformat each message, but since pmail uses the ^Z char as its message
delimiter, formail only sees one large message per mailbox, so i'm now
trying to find a way to split out the messages and pass each one to
formail separately.  someone pointed me to csplit for that, and as far
as i can tell, it's what i want:
$ csplit -sk -n4 pmailbox.PMM /$ZZZ/ {9999}
, where ZZZ is defined as the ^Z char (which i had to do because the
telnet program i'm currently using interprets the ^Z as a suspend, even
if i precede it with a ^V to escape it for the shell), should create a
new file for each message in pmailbox.PMM, up to 9999 of them.  instead,
i get 100 messages split out, and then csplit returns the error in my
subject line.  is this a shell or kernel paramater (i think i read somewhere 
about a max # of files that a single process could create), or something
else entirely?
	
	tia,
	sweth.



-- 
"Countin' on a remedy I've counted on before
Goin' with a cure that's never failed me
What you call the disease
I call the remedy"  -- The Mighty Mighty Bosstones


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

* Re: csplit: 100 file limit reached at arg {9999}
  1998-05-02 21:40 csplit: 100 file limit reached at arg {9999} Sweth Chandramouli
@ 1998-05-03  4:08 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1998-05-03  4:08 UTC (permalink / raw)
  To: Sweth Chandramouli, ZSH Users

On May 2,  5:40pm, Sweth Chandramouli wrote:
} Subject: csplit: 100 file limit reached at arg {9999}
}
} 	i'm trying to write a script to convert pegasus mail-style
} mailboxes into the normal unix mbox format, and am having a few problems,
} at least one of which i think is shell-related.  [...]
} i get 100 messages split out, and then csplit returns the error in my
} subject line.  is this a shell or kernel paramater (i think i read somewhere 
} about a max # of files that a single process could create), or something
} else entirely?

The csplit program simply refuses to create more than 100 output files.
The limit you're thinking of is the maximum number of files that a process
can have -open- at the same time; I doubt csplit is keeping all 100 files
open, so that's not likely to be the problem.

} i want to use formail to
} reformat each message, but since pmail uses the ^Z char as its message
} delimiter, formail only sees one large message per mailbox

Is that the only reason formail sees only one message?  What's the text
immediately following each ^Z?  You might be able to get away with using
sed to replace the ^Z with something formail will recognize.  Also, have
you tried "formail -d" ?

} so i'm now
} trying to find a way to split out the messages and pass each one to
} formail separately.

Got perl?

perl -p032 -e 'close(STDOUT); s/.$//; open(STDOUT, "|formail >> mboxfile");'

(That assumes that the last message is not followed by a ^Z.  If it is,
you'll get one extra "From " line at the end of mboxfile.  It also assumes
you've got enough memory to have perl slurp up an entire message before it
sends any output to formail.)

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~1998-05-03  4:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-02 21:40 csplit: 100 file limit reached at arg {9999} Sweth Chandramouli
1998-05-03  4:08 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).