Re: case modification won't work with pattern

2011-03-11 Thread Chet Ramey
>I suggested using parameter expansion with patterns in >: I must be getting old. I thought you were the one who suggested a new builtin. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: case modification won't work with pattern

2011-03-10 Thread Clark J. Wang
On Fri, Mar 11, 2011 at 11:33 AM, Chet Ramey wrote: > On 3/10/11 9:04 PM, Clark J. Wang wrote: > > > > Agree. Almost all of the poeple around me don't understand why it works > that > > way. Maybe some background of the feature requirement can help us to > > understand better. > > The original re

Re: case modification won't work with pattern

2011-03-10 Thread Clark J. Wang
On Fri, Mar 11, 2011 at 11:56 AM, Chris F.A. Johnson wrote: > > I suggested using parameter expansion with patterns in > : > > $ foo=bar > $ echo ${foo^} ## Convert first character > Bar > $ echo ${foo^^} ## Convert all characte

Re: case modification won't work with pattern

2011-03-10 Thread Chris F.A. Johnson
On Thu, 10 Mar 2011, Chet Ramey wrote: On 3/10/11 9:04 PM, Clark J. Wang wrote: On Thu, Mar 10, 2011 at 9:31 PM, Greg Wooledge wrote: On Thu, Mar 10, 2011 at 10:22:12AM +0800, Jerry Wang wrote: var="abcabc" echo "var: ${var}" echo "replace the leading \"ab\" to uppercase:

Re: case modification won't work with pattern

2011-03-10 Thread Chet Ramey
On 3/10/11 9:04 PM, Clark J. Wang wrote: > On Thu, Mar 10, 2011 at 9:31 PM, Greg Wooledge wrote: > >> On Thu, Mar 10, 2011 at 10:22:12AM +0800, Jerry Wang wrote: >>> var="abcabc" >>> echo "var: ${var}" >>> echo "replace the leading \"ab\" to uppercase: ${var^ab}" # expect >> to

Re: case modification won't work with pattern

2011-03-10 Thread Clark J. Wang
On Thu, Mar 10, 2011 at 9:31 PM, Greg Wooledge wrote: > On Thu, Mar 10, 2011 at 10:22:12AM +0800, Jerry Wang wrote: > > var="abcabc" > > echo "var: ${var}" > > echo "replace the leading \"ab\" to uppercase: ${var^ab}" # expect > to get "ABcabc" ? > > The documentation is a bit t

Re: case modification won't work with pattern

2011-03-10 Thread Greg Wooledge
On Thu, Mar 10, 2011 at 10:22:12AM +0800, Jerry Wang wrote: > var="abcabc" > echo "var: ${var}" > echo "replace the leading \"ab\" to uppercase: ${var^ab}" # expect to > get "ABcabc" ? The documentation is a bit terse, admittedly. What the ^ operator does is compare the *first

Re: case modification won't work with pattern

2011-03-10 Thread Clark J. Wang
On Thu, Mar 10, 2011 at 10:22 AM, Jerry Wang < jerry.j.w...@alcatel-lucent.com> wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i486 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' > -DCONF_OSTYPE='linux-gnu' -D

Re: case modification won't work with pattern

2011-03-10 Thread Clark J. Wang
On Thu, Mar 10, 2011 at 10:22 AM, Jerry Wang < jerry.j.w...@alcatel-lucent.com> wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i486 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' > -DCONF_OSTYPE='linux-gnu' -D