[comp.unix.questions] size limit for sed -f ?

arritt@kuhub.cc.ukans.edu (07/12/90)

Is there a limit to the size of the modification file that can be used
with sed?  (Not the source file, but the file containing the sed commands.)
I'm doing stuff like

      sed -f model.sed model.source > model.f

to update a fortran code, and get the error "Too much text" whenever the
model.sed file exceeds something around 10,400 bytes.  Deleting a few lines
at any point in model.sed (thereby shortening it) will eliminate the error,
but once I add a few more mods, the error message comes back.

The machine is a Silicon Graphics 4D/25G running IRIX 3.2.

Any suggestions (other than "keep your mod files small") ?

Thanks,
________________________________________________________________________
Ray Arritt                        | 
Dept. of Physics and Astronomy    |
Univ. of Kansas                   |
Lawrence, KS  66045               |
arritt@kuhub.cc.ukans.edu         |
arritt@ukanvax.bitnet             |
                               

maart@cs.vu.nl (Maarten Litmaath) (07/13/90)

In article <24929.269ba943@kuhub.cc.ukans.edu>,
	arritt@kuhub.cc.ukans.edu writes:
)Is there a limit to the size of the modification file that can be used
)with sed?  (Not the source file, but the file containing the sed commands.)

Yes.  Even under POSIX there are still (lower) limits, though fairly high.
You have to divide your script into (orthogonal) parts and invoke sed a
couple of times in a pipeline:

	sed -f script1.sed input_file | sed -f script2.sed | ...
--
 "and with a sudden plop it lands on usenet.  what is it? omigosh, it must[...]
   be a new user! quick kill it before it multiplies!"      (Loren J. Miller)

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (07/14/90)

In article <7110@star.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
: In article <24929.269ba943@kuhub.cc.ukans.edu>,
: 	arritt@kuhub.cc.ukans.edu writes:
: )Is there a limit to the size of the modification file that can be used
: )with sed?  (Not the source file, but the file containing the sed commands.)
: 
: Yes.  Even under POSIX there are still (lower) limits, though fairly high.
: You have to divide your script into (orthogonal) parts and invoke sed a
: couple of times in a pipeline:
: 
: 	sed -f script1.sed input_file | sed -f script2.sed | ...

Well, that's one way to do it.  Another way is to run it through the
sed-to-perl translator and execute the resulting Perl script.  Perl doesn't
have such limits.

And it might even run faster.

Larry Wall
lwall@jpl-devvax.jpl.nasa.gov