Timeline for How do I remove certain lines (using line numbers) in a file?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 6, 2012 at 17:34 | comment | added | jw013 | Keep in mind the temporary file "in-place" method of sed usually does not work correctly with links of any sort. You may end up overwriting the link with an edited copy of the file, leaving the original in place. | |
| Apr 14, 2011 at 10:29 | comment | added | penguin359 | @fred If you use a full-screen text editor to modify the file are you editing a file in-place? Most editors including Vim use the same logic in-place sed uses. | |
| Apr 14, 2011 at 10:08 | comment | added | Faheem Mitha | Most "in-place" methods use a temporary file, in my experience. | |
| Apr 13, 2011 at 22:40 | vote | accept | tshepang | ||
| Apr 13, 2011 at 14:36 | comment | added | Peter.O |
I've often wondered about the possibly misleading term in-place, when referring to 'sed', so I looked it up in 'man sed': --in-place[=SUFFIX] This option specifies that files are to be edited in-place. GNU sed' does this by creating a temporary file and sending output to this file rather than to the standard output.` ... I don't know about any other 'sed' but the logistics of updating "in place" with a stream editor don't "compute" :)
|
|
| Apr 12, 2011 at 22:44 | history | edited | tshepang | CC BY-SA 3.0 |
added 81 characters in body
|
| Apr 12, 2011 at 22:00 | comment | added | Gilles 'SO- stop being evil' |
@Tshepang: Use ed, or GNU sed -i, or sponge, or a large file method.
|
|
| Apr 12, 2011 at 21:24 | comment | added | enzotib | I suggest sed -i file | |
| Apr 12, 2011 at 21:02 | comment | added | tshepang | Is there a way of doing it in-place? | |
| Apr 12, 2011 at 21:00 | history | answered | pdo | CC BY-SA 3.0 |