FAQ
•
Search
•
Register
•
Log in to check your private messages
Log in
Knowledge Base
tip discussion:
Search and replace using sed
Here's a basic example of using sed. Search file_src for all ocurrences of string1 and replace them with string2, write the output to file_dest sed s/string1/string2/g file_src > file_dest ...
View this tip
Search and replace using sed
Computing and IT Support Forums
»
Operating Systems
»
Unix
Author
Message
rahoolm
Post subject:
Search and replace using sed
Posted:
Dec 20, 2011 - 06:21 PM
Joined: Dec 20, 2011
Posts: 1
Status: Offline
If the string to replace contains / then use the following command to search and replace
Code:
sed s@string/containing/@replacing/with/stringcontaining/@g fileinput > fileoutput
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
Jump to:
Select a forum
Forum index
|--[Databases]
| |-- Oracle
| |-- SQL Server
| |-- MySQL
| |-- PostgreSQL
|--[Programming]
| |-- PHP
| |-- JavaScript
|--[Operating Systems]
| |-- Unix
| |-- Windows
|--[Internet and World Wide Web]
| |-- Apache Web Server
All times are GMT
Computing and IT Support Forums
»
Operating Systems
»
Unix