I want to uppercase just the first character in my string with bash.
foo=\"bar\";
//uppercase first character
echo $foo;
should print \"B
This works too...
FooBar=baz
echo ${FooBar^^${FooBar:0:1}}
=> Baz
FooBar=baz
echo ${FooBar^^${FooBar:1:1}}
=> bAz
FooBar=baz
echo ${FooBar^^${FooBar:2:2}}
=> baZ
And so on.
Sources:
Inroductions/Tutorials: