Skip to main content
added 530 characters in body
Source Link
theBuzzyCoder
  • 2.8k
  • 2
  • 32
  • 26

Converting case is done for alphabets only. So, this should work neatly.

I am focusing on converting alphabets between a-z from upper case to lower case. Any other characters should just be printed in stdout as it is...

Converts the all text in path/to/file/filename within a-z range to A-Z

For converting lower case to upper case

cat path/to/file/filename | tr 'a-z' 'A-Z'

For converting from upper case to lower case

cat path/to/file/filename | tr 'A-Z' 'a-z'

For example,

filename:

my name is xyz

gets converted to:

MY NAME IS XYZ

Example 2:

echo "my name is 123 karthik" | tr 'a-z' 'A-Z'
# Output:
# MY NAME IS 123 KARTHIK

Example 3:

echo "my name is 123 &&^&& #@$#@%%& kAR2~thik" | tr 'a-z' 'A-Z'
# Output:
# MY NAME IS 123 &&^&& #@0@%%& KAR2~THIK

Converts the all text in path/to/file/filename within a-z range to A-Z

cat path/to/file/filename | tr 'a-z' 'A-Z'

For example,

filename:

my name is xyz

gets converted to:

MY NAME IS XYZ

Example 2:

echo "my name is 123 karthik" | tr 'a-z' 'A-Z'
MY NAME IS 123 KARTHIK

Converting case is done for alphabets only. So, this should work neatly.

I am focusing on converting alphabets between a-z from upper case to lower case. Any other characters should just be printed in stdout as it is...

Converts the all text in path/to/file/filename within a-z range to A-Z

For converting lower case to upper case

cat path/to/file/filename | tr 'a-z' 'A-Z'

For converting from upper case to lower case

cat path/to/file/filename | tr 'A-Z' 'a-z'

For example,

filename:

my name is xyz

gets converted to:

MY NAME IS XYZ

Example 2:

echo "my name is 123 karthik" | tr 'a-z' 'A-Z'
# Output:
# MY NAME IS 123 KARTHIK

Example 3:

echo "my name is 123 &&^&& #@$#@%%& kAR2~thik" | tr 'a-z' 'A-Z'
# Output:
# MY NAME IS 123 &&^&& #@0@%%& KAR2~THIK
Source Link
theBuzzyCoder
  • 2.8k
  • 2
  • 32
  • 26

Converts the all text in path/to/file/filename within a-z range to A-Z

cat path/to/file/filename | tr 'a-z' 'A-Z'

For example,

filename:

my name is xyz

gets converted to:

MY NAME IS XYZ

Example 2:

echo "my name is 123 karthik" | tr 'a-z' 'A-Z'
MY NAME IS 123 KARTHIK