Trying to change all the characters in goodStuff file to uppercase.
I want to use tr '[a-z]' '[A-Z]' but don't know how to do the rest.
Can you help?
Hey there!
You cannot modify the same file using tr command . But it is possible to store the output of this command in another file.For example:
$ tr "[a-z]" "[A-Z]" < goodStuff >output
This command uses goodStuff as input, and converts the characters from lowercase to uppercase.
or
$ cat goodStuff | tr "[a-z]" "[A-Z]" >output
This command reads the file using cat and then uses its output as the input for tr command then stores the output of tr command in output file
or
$tr "[:lower:]" "[:upper:]" < goodStuff>output
Please feel free to ask if you have any queries , in the comments.
Thumbs up appreciated:)
Get Answers For Free
Most questions answered within 1 hours.