String Format¶
convert to lowercase¶
convert to uppercase¶
swap case¶
convert to camel case¶
while read txt; do
a=($txt) #treat as array init by parentheses, each word an element
echo ${a[@]^} #[@] references all elements at once, and ^ converts first character to uppercase
done
printf format¶
printf "%-10.10s [%8d]:", i, v[i]
%-10.10sleft align and pad to 10 characters but also truncate at 10 characters%8dassure the integer is printed in an 8-character field (right aligned)