convert capital letters to lowercase in shell script
Just use tr command to transform lowercase letters into uppercase as:
tr a-z A-Z < file.txt #transforms letters into uppercase in a file
echo 'HELLO' | tr A-Z a-z #Outputs: 'hello'
3.83
6
x="HELLO"
echo $x # HELLO
y=${x,,}
echo $y # hello
z=${y^^}
echo $z # HELLO
Thank you!
6
0
4.5
4
# Basic syntax:
tolower(string)
toupper(string)
# Example usage:
awk '{print tolower($0)}' input_file
# This prints every row ($0) converted to lowercase
awk '{print toupper($3)}' input_file
# This would print the third field ($3) converted to uppercase
Thank you!
4
0
Are there any code examples left?
New code examples in category Shell/Bash