ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [20201202]sed加行号.txt

[20201202]sed加行号.txt

原创 Linux操作系统 作者:lfree 时间:2020-12-02 11:15:53 0 删除 编辑

[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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7969544