Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

csplit: 100 file limit reached at arg {9999}

8 views
Skip to first unread message

Sweth Chandramouli

unread,
May 2, 1998, 3:00:00 AM5/2/98
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


Bart Schaefer

unread,
May 2, 1998, 3:00:00 AM5/2/98
to Sweth Chandramouli

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


0 new messages