bash convert string to uppercase

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'

4.1
10
Awgiedawgie 440220 points

                                    var=hello #For Bash Version higher than 4.3.33 try these
echo ${var''} #Uppercase whole string
HELLO
echo ${var'} #Uppercase only first char of string
Hello
var2=BYE
echo ${var2,} #Lowercase whole string
bye
echo ${var2,,} #Lowercase only first char of string
bYE
echo $var | tr 'a-z' 'A-Z' #For lower versions of Bash just use tr command
HELLO

4.1 (10 Votes)
0
4.43
7
Phoenix Logan 186120 points

                                    # 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

4.43 (7 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
bash shell script to validate uppercase or lowercase string convert uppercase to lowercase in bash bash script convert to lowercase upper case in bash script\ bash convert capital char to small shell script to uppercase to upper bash how to convert lower case to upper case via bash bash to uppercase tr bash file to uppercase bash to upper for string bash string lowercase convert string to lowercase bash bash uppercase a variable bash shell script to count uppercase and lowercase letters bash uppercase or lowercase variables string ignore upper lower case bash turn to caps bash bash script make variable uppercase bash script convert to uppercase bash capitalize string bash lowercase to uppercase bash echo convert uppercase shell script convert string to uppercase Convert string to lowercase using bash bash string to uppercase bash uppercase string variable bash command to convert to uppercase shell command to convert to uppercase bash tr upper to lower convert to uppercase in shell script bash to uppercase bash make string lowercase bash script to uppercase bash script to upperca how to uppercase in bash convert string from uppercase to lowercase in shell script tr upper lower bash bash variable uppercase bash echo variable uppercase uppercase echo bash upper case bash convert lowercase to uppercase in shell script bash to lowercase convert a string to upper case using bash programming bash uppercase bash upper case bash variable to uppercase bash convert string to lowercase bash make uppercase bash convert to uppercase convert capital letters to lowercase in shell script bash string to lowercase Lower case and upper case comparison bash to uppercase bash lower and upper case bash ^ lower and upper case bash bash uppercase sentence bash to upper case shell bash to uppercase bash uppercase string shell script convert to upper case bash convert to lowercase shell lowercase string bash change case of variable to upper case bash bash call caps bash script lowercase string touppercase bash linux lower case string bash uppercase to lowercase skrupt to lowercase bash lowercase all string bash lowercase string bash capitalize linux lowercase script bash change case of string to lowercase shell script bash to lower case bash lowercase and trim bash change to upper case bsh to uppercase bash lower case shell script to lowercase bash uppercase strings to llowercase convert from lower to uppercase in shell make string uppercase or lowercase in bash bash echo to uppercase convert to uppercase in c bash uppercase commands to lowercase linu shell to lowercase change string case bash bash lowercase all letters echo uper case linux tolowercase bash convert string to uppercase make a word uppercase bash uppercase to lowercase bash linux convert upper case to lower case linux make input lower case bash change variable to lowercase uppercase a string linux bash uppercase word lowercase bash bash lowercase variable bash do-lowercase-version convert to uppercase command bash change case linux string lowercase string to lower case in shell script tolower in shell script convert to lowercase in shell script shell script string to lowercase case change in bash bash word to uppercase bash convert lower to uppercase bash transform uppercase to lowercase bash how to convert text to lowercase or uppercase
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source