Reputation: 143
example:
a=$( printf "%X" 10 )
b=${a,,}
anyone knows what is the difference between the value for variable a
and variable b
? what the purpose of the second expression?
Upvotes: 1
Views: 70
Reputation: 11479
$ a=$(printf "%X" 10) # assign the HEX conversion value in upper case.
$ echo "${a}" # Print the value
A
$ echo "${a,,}" # Parameter expansion to bring everything to lowercase
a
Instead of assigning b=${a,,}
, you can do,
$ b=$(printf "%x" 10)
$ echo "$b"
a
Upvotes: 2