Operating System - Linux
1829594 Members
1506 Online
109992 Solutions
New Discussion

sed limitation 100 commands HP-UX with patch PHCO_31246

 
Patricia McCormick
New Member

sed limitation 100 commands HP-UX with patch PHCO_31246

Hello,
Can you confirm that on HP-UX with patch PHCO_31246 there is still the 100 command limit with sed?
I realize gsed is a possible workaround, but I require confirmation of sed.
Thank you very much,
Trish
4 REPLIES 4
Steven Schweda
Honored Contributor

Re: sed limitation 100 commands HP-UX with patch PHCO_31246

Did that patch update the "man" page?

td176> man sed
[...]
DESCRIPTION
sed copies the named text files (standard input default) to the
standard output, edited according to a script containing up to 100
commands. [...]

I'd tend to believe the doc, unless a test
showed that reality diverges therefrom.

td176> uname -a
HP-UX td176 B.11.23 U ia64 1928826293 unlimited-user license
James R. Ferguson
Acclaimed Contributor

Re: sed limitation 100 commands HP-UX with patch PHCO_31246

Hi Trish:

The patch makes no mention of increasing the 100-ccommand limit and *it doesn't*. You can test that this way:

# perl -le 'print "s/a/b/g" for (1..99)' > /tmp/sedprog

# echo "aaa" | -f /tmp/sedprog
bbb

# perl -le 'print "s/a/b/g" for (1..100)' > /tmp/sedprog
sed: There are too many commands for the s/a/b/g function.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: sed limitation 100 commands HP-UX with patch PHCO_31246

Hi (again) Trish:

I should add that depending on what the 'sed' filtration does, you can pipe together two or more 100-command limited programs to enable you to exceed the 100-command barrier:

# sed -f ./inputfile ./sedprog1 | sed -f ./sedprog2

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: sed limitation 100 commands HP-UX with patch PHCO_31246

>Steven: Did that patch update the "man" page?

That limitation is still documented on 11.31.