GNU bug report logs - #32069
Man page description is wrong for -i

Previous Next

Package: sed;

Reported by: Matthew Jenkins <mjenki03 <at> gmail.com>

Date: Fri, 6 Jul 2018 00:54:01 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Matthew Jenkins <mjenki03 <at> gmail.com>
To: bug-sed <at> gnu.org
Subject: Man page description is wrong for -i
Date: Thu, 5 Jul 2018 19:30:15 -0500
[mjenkins <at> hulk ~]$ sed --version
sed (GNU sed) 4.5
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed <at> gnu.org>.




On Fedora 28.

In the man page the description for -i is as follows:
       -i[SUFFIX], --in-place[=SUFFIX]

              edit files in place (makes backup if SUFFIX supplied)


However the actual behavior is it's replacing the original with a copy
and not editing in place. This can cause confusion for why sed is
breaking hardlinks. Example:

[mjenkins <at> hulk test]$ touch banana
[mjenkins <at> hulk test]$ stat banana | grep Inode
Device: fd07h/64775d Inode: 8782051     Links: 1
[mjenkins <at> hulk test]$ sed -i '' banana
[mjenkins <at> hulk test]$ stat banana | grep Inode
Device: fd07h/64775d Inode: 8781989     Links: 1

I'm pretty sure replacing with the copy is intentional behavior, so
can the manual be updated to reflect this?


Thanks,
Matthew




This bug report was last modified 7 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.