![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replacing a string in nth line | maxmave | Shell Programming and Scripting | 1 | 06-04-2008 06:32 PM |
| replacing string in an XML file | subin_bala | Shell Programming and Scripting | 2 | 06-03-2008 08:14 AM |
| problem in replacing a string | ragavhere | Shell Programming and Scripting | 9 | 05-02-2008 10:02 AM |
| string replacing | priya_9patil | Shell Programming and Scripting | 1 | 11-03-2006 12:05 PM |
| replacing a string in all files in a dir | chiru_h | Shell Programming and Scripting | 3 | 07-25-2006 05:40 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need help regarding replacing a part of string
Hi all
suppose i have a string "abacus sabre", i need to replace occurences 'ab' with 'cd' and i need to store this result into same string and i need to return this result from script to the calling function, where as the string is passed from calling function. i tried like this mainStr="abacus" old_word="ab" new_word="cd" result=`sed -i s/$old_word/$new_word $mainstr ` return result |
|
||||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|