So, what it actually says is:
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if extension supplied)
For someone new to manpages it might be a bit ambiguous, but man man
states that [] mean it's optional, and the comment underneath the
-i[SUFFIX] line does make it clear that adding a suffix will back it up.
I suppose the unclear part is exactly what the backup will be named.
That sort or requires extrapolating from the whole "why am i giving a
suffix?" thing.
I'm going to mark this a string-fix and bitesize bug since changing a
manpage string is simple enough.
** Changed in: sed (Ubuntu)
Status: Invalid => Confirmed
** Summary changed:
- In sed, -ir options generate second file with r appended to end of name
+ sed -i option needs clarification in manpage
** Description changed:
- Program: GNU sed version 4.1.5
-
- Steps for bug reproduction are as follows:
-
- # Generate file called "a" with one line consisting of "1234"
- echo "1234" > a
-
- # Causes the line "1234" to become "a234" in file "a"
- sed -ri 's/1/a/' a # Proper behaviour
-
- # Causes the line "a234" to become "ab34" in file "a"
- # However, another file called "ar" has been generated with the line "a234"
(which are the previous contents of "a")
- sed -ir 's/2/b/' a # Improper behaviour
-
- This can be done without any commands.
- Example:
- touch b; sed -ir '' b # Creates file 'br' which should not exist
-
- I ran this test using the LiveCD (to check if any updates might be
- related to the bug) and found that the bug could be reproduced there as
- well.
-
- If more information is required then I will provide it.
+ What the sed -i[SUFFIX] does (specifically, the fact that it appends the
+ suffix to the backup's filename) is ambiguous.
** Tags added: bitesize string-fix
--
sed -i option needs clarification in manpage
https://bugs.launchpad.net/bugs/271606
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs