退出状态
sed不向grep一样,不管是否找到指定的模式,它的退出状态都是0。只有当命令存在语法错误时,sed的退出状态才不是0。
对文件所属主owner的影响
一直以为sed -i只是对文件编辑,不会影响文件的权限,最近才知道会改变文件的owner,会改成当前用户的owner, 在ws3.0上会有这种情况,在centos4.4或更高的版本不会产生这样的问题
[root@CT53-64b logs]# sed --version GNU sed version 4.1.5 Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, to the extent permitted by law. |
14:31 |
[root@WAPI01 ~]# sed --version GNU sed version 4.1.2 Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, to the extent permitted by law. |
14:31 |
[root@jsz1wl044 tmp]# sed --version GNU sed version 4.0.7 Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, to the extent permitted by law. |
阅读(1164) | 评论(1) | 转发(0) |