Need a script to search and replace text in file using shell script
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The first step in scripting is figuring out exactly what you want done. Exactly.
Sure, you want to replace text, and you attempt to show how this would work on the command line. A good first step.
But do you want to specify the input and output file names in that command also? Or is that command just supposed to be a filter (in which case a simple, one-line sed command should work, with no script necessary)?
If you don't know what a "filter" is, drop everything and google:
because there is much you need to read before starting out.
Hope this helps.
Last edited by email@example.com; 06-20-2007 at 12:23 PM.
Well.... the wording is fine :} ... it just suggests that those aren't
your own words as it contradicts the statement that you're new to
To be efficient with shell scripting you need to know the basic
command line tools. Read the man pages for grep, sed, and maybe
awk. Also scour this forum for those tools. You'll find tons
of useful examples.
And no, no one here will do your homework for you :}