Add text at the end of each line

前端 未结 7 2094
死守一世寂寞
死守一世寂寞 2020-11-28 20:24

I\'m on Linux command line and I have file with

127.0.0.1
128.0.0.0
121.121.33.111

I want

127.0.0.1:80
128.0.0.0:80
121.121         


        
7条回答
  •  天涯浪人
    2020-11-28 20:35

    sed -i 's/$/,/g' foo.txt

    I do this quite often to add a comma to the end of an output so I can just easily copy and paste it into a Python(or your fav lang) array

提交回复
热议问题