Changing the first letter of every line in a file to uppercase

后端 未结 6 1615
无人及你
无人及你 2021-01-02 11:04

I need to change the first letter of every line in a file to uppercase, e.g.

the bear ate the fish.
the river was too fast.

Would become:

6条回答
  •  -上瘾入骨i
    2021-01-02 11:33

    pearl.311> cat file1
    linenumber11
    linenumber2  
    linenumber1
    linenumber4
    linenumber6
    pearl.312> awk '{print toupper(substr($0,1,1))""substr($0,2)}' file1
    Linenumber11
    Linenumber2  
    Linenumber1
    Linenumber4
    Linenumber6
    pearl.313> 
    

提交回复
热议问题