RE: sed file processing?
Jude DaShiell <[email protected]>
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
Yes, the -i option is available thanks much for this assist. On Fri, 14 Feb 2014, [email protected] wrote: > Thank you for posting the script. Those "From" lines do have an EOL marker. If I understand your script right, the answer is that sed does not normally save the file. It just sends the output to stdout (rf file is unchanged), for good reason. This gives you all the flexibility to automate things as you discuss. > > So you have two choices: > > #1 - Save the output and then overwrite original file with edited version: > > $ sed -e 's/^/blacklist-/' rf > edited-file.txt > $ mv edited-file.txt rf > > #2 - Use -i option (if available) to edit the file "in-place" (it actually creates an intermediate temporary file behind the scenes). > > $ sed -i -e 's/^/blacklist-/' rf > > Daniel jude <[email protected]>