What does 2 commas after variable name mean in bash?

LinuxBashShell

Linux Problem Overview


Recently I came across this syntax:

${reportName,,}

I could not find anything by googling, so does anyone know what does those ,, mean?

Linux Solutions


Solution 1 - Linux

This is called "Parameter Expansion" available in bash version 4+ . To change the case of the string stored in the variable to lower case.Eg:

var=HeyThere
echo ${var,,}
heythere

You may want to try some additional commands and check the effect : [source][1]

${var^}
${var^^}
${var,}
${var,,}

Note: "Parameter Expansion" is present in man bash .Search for it. [1]: http://wiki.bash-hackers.org/syntax/pe

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser1308345View Question on Stackoverflow
Solution 1 - LinuxP....View Answer on Stackoverflow