[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ping] declare -c still undocumented.
From: |
felix |
Subject: |
Re: [ping] declare -c still undocumented. |
Date: |
Fri, 13 Nov 2020 10:33:55 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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
--
Félix Hauri - <felix@f-hauri.ch> - http://www.f-hauri.ch