![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Search and replace | jobbyjoseph | Shell Programming and Scripting | 12 | 02-07-2008 02:33 AM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 10:24 AM |
| Search & replace | videsh77 | Shell Programming and Scripting | 1 | 01-14-2005 07:10 AM |
| Help, sed search&replace | mle | Shell Programming and Scripting | 2 | 02-13-2004 01:28 PM |
| search and Replace | mukeshannamalai | UNIX for Advanced & Expert Users | 4 | 09-14-2001 06:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how can the search and replace can be done interactively
hi,
To search and replace a string in multiple files i am using following command: find . -name '*.txt' -print0 |xargs -0 perl -pi -e 's/find_string/replace_string/g' I want to be prompted while replacing the string. how this can be done. thanks for every help. |
|
||||
|
In theory, simply replace the Perl script with one which prompts you for each substitution. In practice, for usability reasons, you would probably want to use the search and replace features of an editor, and simply feed the editor with a simple script. That way, you get undo, a nice way for the user to see the wider context of each change, and of course, the ability to make unrelated edits when you see something which needs fixing, etc. I personally recommend Emacs, but whatever editor you, or your users, are familiar with should do (unless it's too GUIey for its own good ...).
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|