[Top][All Lists]

[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:


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

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

Like this:

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

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

   myvar="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; echo 

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

reply via email to

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