[Leaplist] teach me please about this code
tonyb
tonyb at abcc.linuxceptional.com
Sat Jan 5 19:10:07 GMT 2008
The short answer is: I don't know. The velocity of change in open
source is too great for me to keep track of what features are available
when and where. I simply try to maintain a working subset.
Cheers,
Tony
John Simpson wrote:
...
>
> is the ${...%pattern} operator specific to bash, or does it work with
> any /bin/sh variant?
>
> reading the man page about it, i also find a ${.../pattern/string}
> operator. i remember reading about these before, but i couldn't get my
> head wrapped around what they were doing, and it wasn't relevant to what
> i was working on at the time, so i ignored it but always meant to get
> back to it... and of course, never did.
>
> i just wrote a test script to show me what these operators actually do.
> i find it easier to understand if i can see a list of "before and after"
> cases...
>
> $x abc_123_abc_789_abc
> ${x%abc}XYZ abc_123_abc_789_XYZ
> ${x#abc}XYZ _123_abc_789_abcXYZ
> ${x/abc/XYZ} XYZ_123_abc_789_abc
> ${x//abc/XYZ} XYZ_123_XYZ_789_XYZ
> ${x/#abc/XYZ} XYZ_123_abc_789_abc
>
> ----------------------------------------------------------------
> | John M. Simpson --- KG4ZOW --- Programmer At Large |
> | http://www.jms1.net/ <jms1 at jms1.net> |
> ----------------------------------------------------------------
> | http://video.google.com/videoplay?docid=-1656880303867390173 |
> ----------------------------------------------------------------
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Leaplist mailing list
> Leaplist at leap-cf.org
> http://lists.leap-cf.org/mailman/listinfo/leaplist
--
May all your bits be in the correct order.
More information about the Leaplist
mailing list