sed and Mac OS X differences with to upper, to lower and whole capture control sequences

前端 未结 2 509
独厮守ぢ
独厮守ぢ 2020-12-31 13:20

I am trying to take the last two letters out of a filename which are uppercase and append them to the filename in lowercase. I expeceted the command:



        
2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 13:39

    awk alternative:

    ls | awk '{print $0 tolower(substr($0,length($0)-1,2))}'
    

提交回复
热议问题