I have this piece of code :
target='xfce/*'
file_name="All files from ${target/\/*}"`
Later on, I do
echo "Copying [$file_name] folder"
and it shows :
Copying [All files from xfce] folder
I wanted it to show
Copying [All files from XFCE] folder
instead (notice that XFCE is now capitalized)
I know how to capitalize with ${var^^}, but how can do both substitution and capitalization?
I tried
file_name="All files from ${target/\/*^^}"
or
file_name="All files from ${target^^/\/*}"
but none works. Is there a way to achieve substitution AND capitalization in the same command ?
What I would do: