delcomment.sh 以*开头 以//开头 空白行
-
/[:*:]/d
-
/[:/:][:/:]/d
-
/^$/d
TestMain类
-
package test;
-
/*
-
*====
-
*====
-
**/
-
-
public class TestMain
-
{
-
//The main
-
public static void main(String []args)
-
{
-
System.out.println("The main");
-
}
-
}
[root@localhost sed]# sed -f delcomment.sh TestMain.java
处理完之后:
-
package test;
-
public class TestMain
-
{
-
public static void main(String []args)
-
{
-
System.out.println("The main");
-
}
-
}
阅读(1739) | 评论(0) | 转发(0) |