On Thu, Jan 30, 2003 at 11:55:07AM +0000, Angus Leeming wrote:
> > Concerning cheapness:
> >
> > y=${x%<*}
> > translator=${j#*}
> > y=${x#*<}
> > email=${y%>*}
>
> Never seen nothing like this. Can you explain it to me? It looks like
> gook to me ;-)
man bash
/##
${parameter#word}
${parameter##word}
The word is expanded to produce a pattern just as
in pathname expansion. If the pattern matches the
beginning of the value of parameter, then the
result of the expansion is the expanded value of
parameter with the shortest matching pattern (the
``#'' case) or the longest matching pattern (the
``##'' case) deleted. [...]
I learned about it only a few weeks ago and I _really_ like it.
Using bash is no restriction for me.
> Give me a little example of it in action and I'll try it here with
> dumn old vanilla sh.
I don't think sh will work.
Andre'
--
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)