Timeline for Is there a way to modify a file in-place?
Current License: CC BY-SA 4.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 31, 2023 at 5:39 | comment | added | Stéphane Chazelas | @AndréChalella, no we need to open the file a second time so we get two separate open file descriptions that have independant cursors within the file. | |
| Jul 30, 2023 at 23:19 | comment | added | André Chalella |
Amazing, @StéphaneChazelas (as always). Can we do cat <&1 instead of cat < bigfile?
|
|
| May 8, 2021 at 8:51 | comment | added | Stéphane Chazelas | @akhan, that other approach replaces the file with a new one, it doesn't overwrite the same file in place. In particular, permissions ownership, and other metadata of the original file will be lost. | |
| May 8, 2021 at 8:38 | history | edited | Stéphane Chazelas | CC BY-SA 4.0 |
deleted 3 characters in body
|
| Jan 3, 2019 at 0:09 | comment | added | akhan | @StéphaneChazelas How does your solution compares to this answer? It apparently does the same thing but looks simpler. | |
| Jul 31, 2017 at 9:02 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 |
added 308 characters in body
|
| Jul 31, 2017 at 7:05 | comment | added | Stéphane Chazelas | @nealmcb, see edit. | |
| Jul 31, 2017 at 7:05 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 |
added 442 characters in body
|
| Jul 31, 2017 at 3:21 | comment | added | nealmcb |
Absolutely brilliant - thank you. I was there then, but don't remember this.... A reference for the "36 year old" standard would be fun, since it isn't mentioned at en.wikipedia.org/wiki/Bourne_shell. And what was it used for? I see a reference to a bug fix in SunOS 5.6: redirection "<>" fixed and documented (used in /etc/inittab f.i.). which is one hint.
|
|
| Feb 1, 2016 at 22:12 | comment | added | Stéphane Chazelas | @AaronBlenkush, see edit. | |
| Feb 1, 2016 at 22:12 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 |
added 441 characters in body
|
| Feb 1, 2016 at 21:57 | comment | added | Aaron Blenkush |
Can you explain the perl -e 'truncate STDOUT, tell STDOUT'? It works for me without including that. Any way to achieve the same thing without using Perl?
|
|
| May 19, 2015 at 16:59 | history | answered | Stéphane Chazelas | CC BY-SA 3.0 |