KSH substring function (is it on your system?)

A DeSimone alex at rruxc.UUCP
Sat Nov 9 01:11:40 AEST 1985


In a previous posting, I asked for help on the syntax of KSH's substring
builtin.  Among others, Tom @ gamma!hoqam!twb replied (BTW, thanx Tom):
> Here is what an older manual says, hope it helps
> substring [ -lL lpat ] string [ rpat ]
> Prints the substring obtained by deleting from the  string  the
> pattern  lpat  on the left and  rpat  on the right. A pattern is
> described in File Name Generation above.  The -l option deletes the
> shortest matching pattern and the -L flag deletes the largest
> matching pattern on the left.  If  rpat  is given the
> shortest matching pattern on the left is deleted.
The impetus behind using substring is that it's builtin and so is faster than
expr.  Unfortunately, Tom also points out that substring is missing from his
latest version of KSH:
> Evidently substring has gone away in the latest ksh, maybe that's
> why it is not in your manual - It's not in the latest manual here
> either.
This makes me very uncomfortable about using it.
I have it (substring) here on a VAX (S5r2) and on my AT&T unixpc(S5r0) at home.
I would be interested to know if netters have it on their KSH (even if it's
not documented).  In particular, please email a message to me indicating what
version of UN*X you're running and whether or not your KSH has substring.
Thanks much.  I'll summarize to the net.  BTW, if anyone *knows* if substring
has officially been dropped from KSH and why, please drop me a note.

Alex
..!{ihnp4,allegra}!rruxc!alex
-- 

  Alex DeSimone @ Bell Communications Research
  ..!{ihnp4,allegra}!rruxc!alex

** Disclaimer?  I don't need no stinkin' disclaimer! **



More information about the Comp.unix mailing list