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
> uname output: Linux Xubuntu 2.6.31-22-generic #73-Ubuntu SMP Fri Feb 11 > 17:36:01 UTC 2011 i686 GNU/Linux > Machine Type: i486-pc-linux-gnu > > Bash Version: 4.0 > Patch Level: 33 > Release Status: release > > Description: >The case modification won't w

Re: case modification won't work with pattern

2011-03-10 Thread Clark J. Wang
> uname output: Linux Xubuntu 2.6.31-22-generic #73-Ubuntu SMP Fri Feb 11 > 17:36:01 UTC 2011 i686 GNU/Linux > Machine Type: i486-pc-linux-gnu > > Bash Version: 4.0 > Patch Level: 33 > Release Status: release > > Description: >The case modification won't w

case modification won't work with pattern

2011-03-09 Thread Jerry Wang
Bash Version: 4.0 Patch Level: 33 Release Status: release Description: The case modification won't work with pattern. I have a simple script a.sh, please see below: #! /bin/bash var="abcabc" echo "var: ${var}" echo "repla