Created
December 16, 2024 14:00
-
-
Save edwingustafson/f3142420438c78b3f1e92ab329331151 to your computer and use it in GitHub Desktop.
Capitalize string variable contents in Bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
GREETING="hello, world!" | |
echo ${GREETING} | |
echo ${GREETING^} | |
echo ${GREETING^^} | |
exit 0 | |
Sample output: | |
hello, world! | |
Hello, world! | |
HELLO, WORLD! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment