Computing.Net > Forums > Unix > Substitution Commands into Shell Script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Substitution Commands into Shell Script

Reply to Message Icon

Name: Flipflopin
Date: September 24, 2009 at 10:53:06 Pacific
OS: Windows XP
Product: Windriver Free bsd v4.4 unix
Subcategory: Configurations
Comment:

Not sure if that's the right product. I was wondering if someone can help? I am trying to create a shell script taking three parameters for the two lines below. Not sure how to do this.

mv myFile.txt myFile.txt.bak
sed 's/foo/bar/g' myFile.txt.bak > myFile.txt

I am not sure about the bak file and txt file and where to input those in the script.

The string to be replaced is foo and the string to replace with is bar. The name of the file to make the substitution is myFile.txt



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Substitution Commands into Shell Script

Shell Script help - move records www.computing.net/answers/unix/shell-script-help-move-records/7061.html

shell script help! www.computing.net/answers/unix/shell-script-help-/4809.html

Using hex-code in shell script www.computing.net/answers/unix/using-hexcode-in-shell-script/4227.html