Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: csplit: 100 file limit reached at arg {9999}



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



Messages sorted by: Reverse Date, Date, Thread, Author