cc: [email protected]
Subject: Re: [uwin-users] Korn shell patterns
--------
> Can someone please explain to me this behaviour?:
>
> string=string
> print ${string//+(g)}
This compares string to the pattern +(g) and subtracts off the
matching part. In this case the matching part is the training g
so the result is string.
>
> returns "strin", as you would expect; but
>
> print ${string//!(g)}
This compares string to the pattern !(g) and subtracts off the
matching part. The pattern !(g) matches everything except g itself
and therefore string matches !(g) and it is subtracted off so the
result is the empty string.
>
> returns blank ... I was expecting "g"
print ${string//!(*g)}
would give g since !(*g) matches strin.
>
> Any help would be appreciated,
>
> Doug
>
David Korn
[email protected]
_______________________________________________
uwin-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/uwin-users