Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2790988
  • 博文数量: 471
  • 博客积分: 7081
  • 博客等级: 少将
  • 技术积分: 5369
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-04 21:55
文章分类

全部博文(471)

文章存档

2014年(90)

2013年(69)

2012年(312)

分类: LINUX

2013-05-06 17:00:29

delcomment.sh 以*开头  以//开头 空白行

点击(此处)折叠或打开

  1. /[:*:]/d
  2. /[:/:][:/:]/d
  3. /^$/d

TestMain类

点击(此处)折叠或打开

  1. package test;
  2. /*
  3. *====
  4. *====
  5. **/

  6. public class TestMain
  7. {
  8.         //The main
  9.         public static void main(String []args)
  10.         {
  11.                 System.out.println("The main");
  12.         }
  13. }

[root@localhost sed]# sed -f delcomment.sh TestMain.java 

处理完之后:

点击(此处)折叠或打开

  1. package test;
  2. public class TestMain
  3. {
  4.         public static void main(String []args)
  5.         {
  6.                 System.out.println("The main");
  7.         }
  8. }



阅读(1686) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~