On SLES 12 sp4, a shell call sed with ‘-i’ flag to modify the file execution and report an errort, This shell worked well on the previous server, The linux user (tried also with root) can create, read and update any files in the NFS mounted folder. But the temporary file created by sed doesn’t work.
cbs@anbob:~/roamingfile> seq 1 5 >123.txt
cbs@anbob:~/roamingfile> id
uid=2001(cbs) gid=6601(onip) groups=6601(onip),100(users),2000(timesten),2001(ttadmin),2002(cbsadm),2003(dba),2004(oinstall)
cbs@anbob:~/roamingfile> sed -i '1d' 123.txt
sed: couldn't close <unknown>: Permission denied
cbs@anbob:~/roamingfile> sed --version
sed (GNU sed) 4.2.2
Note:
If the permission problem usually occurs in the open phase, here is the prompt close, Using strace tracking this show the error is reported when the file generated temporarily by sed try to close.(note root user work fine)
It works well after changing to another version of sed(SLES 11)
cbs@anbob:~/roamingfile> /another_release/sed -i '1d' 123.txt
cbs@anbob:~/roamingfile>
cbs@anbob:~/roamingfile> cat 123.txt
2
3
4
5
cbs@anbob:~/roamingfile> /another_release/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.
There are reasons to suspect that this is a bug in the current sed, and you can use other ksh to report an error.
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




