|
#1
| |||
| |||
| simple sed question
What is wrong with this bash command? $ sed -i 's/localhost/myurl/g' myfile.php sed: 1: "myfile.php": command a expects \ followed by text Why doesn't this work to replace localhost with myurl in all php files? $ sed -i 's/localhost/myurl/g' *.php sed: 1: "myfile.php": command a expects \ followed by text I'm using Snow Leopard. |
|
#2
| |||
| |||
|
Your question have just left me confused a little. Perhaps I know the answer but not sure right now.
|
|
#3
| ||||
| ||||
|
The -i requires that you give an extension, even if it's a non-existent extension (for in-place editing). Change the command to this: Code: sed -i '' 's/localhost/myurl/g' myfile.php
__________________ Mac mini 2.0GHz 10.6.2 • 4GB • 320GB • Superdrive • 4 x 1TB USB 2.0 • LED Cinema Display MacBook 2.0GHz Core 2 Duo - White 10.6.2 • 4GB • 250GB • CD-RW/DVD-ROM iPhone 3G 8GB • iPod Touch 8GB • iPod Photo 60GB • iPod nano 1GB • AT&T U-Verse 18Mb/2Mb http://www.jeffhoppe.com |
|
#4
| |||
| |||
|
Thanks ElDiabloConCaca that's what was not coming to my mind?
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|