Converting bash vars to lowercase
08 Nov 2022Bash has a built-in way of converting variables to lower-case (as opposed to piping things through tr [:lower:]
as I’ve done until now):
a="HELLO";
echo ${a,,};
That’s it, two commas do the trick.
Bash has a built-in way of converting variables to lower-case (as opposed to piping things through tr [:lower:]
as I’ve done until now):
a="HELLO";
echo ${a,,};
That’s it, two commas do the trick.