Activity log for bug #271606

Date Who What changed Old value New value Message
2008-09-18 04:23:08 BigBoy_PDB bug added bug
2008-09-18 05:10:16 Mackenzie Morgan sed: status New Invalid
2008-09-18 05:10:16 Mackenzie Morgan sed: statusexplanation Not a bug, user error. See the manpage. It says -i[suffix]. By putting -ir you are telling it to put an r at the end of the file name. The correct syntax to use is -i -r
2008-09-18 15:22:40 Mackenzie Morgan sed: status Invalid Confirmed
2008-09-18 15:22:40 Mackenzie Morgan sed: statusexplanation Not a bug, user error. See the manpage. It says -i[suffix]. By putting -ir you are telling it to put an r at the end of the file name. The correct syntax to use is -i -r 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.
2008-09-18 15:23:39 Mackenzie Morgan description 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.
2008-09-18 15:23:39 Mackenzie Morgan title In sed, -ir options generate second file with r appended to end of name sed -i option needs clarification in manpage
2008-09-30 09:39:08 Mackenzie Morgan sed: status Confirmed Triaged
2008-09-30 09:39:08 Mackenzie Morgan sed: importance Undecided Wishlist
2008-09-30 09:39:08 Mackenzie Morgan sed: statusexplanation 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.
2009-07-16 22:46:23 Evan R. Murphy sed (Ubuntu): status Triaged Invalid