KSH substring function (is it on your system?)

Griff Smith ggs at ulysses.UUCP
Sat Nov 9 12:26:35 AEST 1985


> > 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
> 

Enough!  Substring is dead, long live substring.  It has been replaced
by the substitution characters "#" and "%".  Assuming you have done
"var=abc.def", the command "echo ${var#abc.} ${var%.def}" will print
"def abc".
-- 

Griff Smith	AT&T Bell Laboratories, Murray Hill
Phone:		(201) 582-7736
Internet:	ggs at ulysses.uucp
UUCP:		ulysses!ggs  ( {allegra|ihnp4}!ulysses!ggs )



More information about the Comp.unix mailing list