Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
General Discussions
Switcher Hangout (Windows to Mac)
'sed -i' syntax not working for Terminal
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="wues" data-source="post: 1321523" data-attributes="member: 221805"><p>The version of sed included in Mac OS X requires an argument for -i command line option. The argument is the extension for backup file. So you need to use</p><p></p><p>sed -i '.bak' '2s/blah/the/' tmp.txt</p><p></p><p>to edit tmp.txt in-place and storing backup in tmp.txt.bak. If you do not want backup it is</p><p></p><p>sed -i '' '2s/blah/the/' tmp.txt</p><p></p><p>HTH,</p><p>Wojtek</p></blockquote><p></p>
[QUOTE="wues, post: 1321523, member: 221805"] The version of sed included in Mac OS X requires an argument for -i command line option. The argument is the extension for backup file. So you need to use sed -i '.bak' '2s/blah/the/' tmp.txt to edit tmp.txt in-place and storing backup in tmp.txt.bak. If you do not want backup it is sed -i '' '2s/blah/the/' tmp.txt HTH, Wojtek [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
General Discussions
Switcher Hangout (Windows to Mac)
'sed -i' syntax not working for Terminal
Top