bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ping] declare -c still undocumented.


From: Chris Elvidge
Subject: Re: [ping] declare -c still undocumented.
Date: Fri, 13 Nov 2020 11:47:25 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4

On 13/11/2020 09:33 am, felix wrote:
On Fri, Nov 13, 2020 at 12:19:27AM +0100, Léa Gris wrote:

Happy 10 years 10 months anniversary to the issue:

<https://lists.gnu.org/archive/html/bug-bash/2010-02/msg00074.html>

         address@hidden:~$ declare -c moo=moo; echo $moo
         Moo

   cap() { local -ca _cap=("$@");echo ${_cap[*]};}
   cap great éric.
   Great Éric.

Like this:
   https://lists.gnu.org/archive/html/bug-bash/2010-02/msg00081.html

   ${parameter:~pattern}  Toggle case of 1st character if matching optional 
pattern
   ${parameter:~~pattern} Toggle case of all characters regarding pattern:

   cap() { local -cl _cap=("$@");echo ${_cap[*]~};}
   cap great éric.
   Great Éric.

   myvar="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; echo 
${myvar~~[H-p]}
   ABCDEFGhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPqrstuvwxyz



But ${var^} still doesn't know that it should apply to the first alpha character in a string. Similar for , and ~. If the first character of the string is a punctuation character, e.g.(, it doesn't work (as I would like it to <g>).

--
Chris Elvidge
England




reply via email to

[Prev in Thread] Current Thread [Next in Thread]