ksh88 problem with substring expansion using "+( )" pattern

Marnix van Ammers mavanamm at pttesac.UUCP
Wed Oct 18 09:39:08 AEST 1989


I can't believe that the following ksh substring expansion should take
*22* seconds on my sun 3/50 (34 seconds on our 3B20A).  All the work
is done internal to ksh.  I'm using ksh88b  (the "+( )" pattern
requires ksh88).

  x=$(set -o)              # Set x to current option settings
  xx="${x##*nolog+( )on}"  # same as `echo "$x"|sed "s/.*nolog  *on//"`

As long as the above takes, I could do about 40+ forks and execs
of sed.  I've found better ways of doing what I wanted to do without
any system calls, but I still can't believe 22 seconds.

Anybody know what's going on?

--
Marnix



More information about the Comp.unix.wizards mailing list