[20201202]sed加行号.txt
--//链接提供一些加行号的方法:http://www.itpub.net/thread-2140068-1-1.html
--//想使用sed实现,上网看了一下:
R:\>cat a.txt
this is a test 1
this is a test 2
this is a test 3
this is a test 4
R:\> sed "=" a.txt | sed "N;s/\n/ /"
1 this is a test 1
2 this is a test 2
3 this is a test 3
4 this is a test 4
--//有点麻烦
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2738704/ ,如需转载,请注明出处,否则将追究法律责任。