KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'd like edit a file with sed on OS X. I'm using the following command: sed 's/oldword/newword/' file.txt The output is sent to the terminal. file.txt is not modified. The changes are saved to file2.txt with this command: sed 's/oldword/newword/' file1.txt > file2.txt However I don't want another file. I just want to edit file1.txt . How can I do this? I've tried the -i flag. This results in the following error: sed: 1: "file1.txt": invalid command code f
Tags (comma-separated)
Save Edits
Cancel