Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

mv myFile.txt myFile.txt.bak sed s/foo/bar/g myFile.txt.bak >myFile.txt or in one step by using the -i flag, which tells sed to edit the file in place

image text in transcribed
image text in transcribed
mv myFile.txt myFile.txt.bak sed s/foo/bar/g myFile.txt.bak >myFile.txt or in one step by using the -i flag, which tells sed to edit the file in place" sed -1 s/too/bar/g myFile.txt In software development, however, substitutions like this often need to be made to many different fil developing a script to streamline the process. d of substitution is con 2 The Assignment You'll be working on this assignment in 3 stages. 2.1 Stage 1 1. Create a directory -/UnixCourse/seriptAsst. 2. Turn the two-line version, above, of the substitution commandsinto a shell script, subast 1l t taking parameters: o the string to be replaced o the string with which to replace it o the name of the file in which to make the substitution For example, echo "This is a test.">myFile.txt /UnixCourse/scriptAsst/substl is are myFile.txt cat myFile.txt should print the line Thare are a test. having replaced all occurrences of "is" in the file myrile. txt by "are", leaving the original file as Similarly echo "Heilo world.">aardvark.dat

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

More Books

Students also viewed these Databases questions