Can I use awk to convert all the lower-case letters into upper-case?

后端 未结 6 1259
醉话见心
醉话见心 2020-12-29 01:38

I have a file mixed with lower-case letters and upper-case letters, can I use awk to convert all the letters in that file into upper-case?

6条回答
  •  死守一世寂寞
    2020-12-29 01:40

    If Perl is an option:

    perl -ne 'print uc()' file
    
    • -n loop around input file, do not automatically print line
    • -e execute the perl code in quotes
    • uc() = uppercase

    To print all lowercase:

    perl -ne 'print lc()' file
    

提交回复
热议问题