The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 02-02-2008
Prahlad Prahlad is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 11
If you have only one or limited patter to replace then it can be done easily with sed as explained earlier.

Please follow the steps.

--------
1) Save thispatternthatpattern in a file called test
2) Now according to you thispatternthatpattern should be converted to this(pattern)that(pattern) .
3) Now type following command
----------
sed -i 's/patter/(pattern)/g' test
-----------

4) See the o/p using "cat test". It should be as pasted below.

bash-3.1$ cat test
this(pattern)nthat(pattern)n

--------

Thanks,