Customer Service Chat
Get quote & make Payment
Unix Shell, Basic Computer Science
Write a shell script, change-lines, which will substitute a string for a replacement string for each occurance of the string in files specified.
The original file will be saved, with the same filename with the .keep extension unless the -n option is present.
You may use a temporary file for this script.
Remember the search string and or the replacement string can have special characters in them, so you must use proper quoting techniques.
The script will use following options:
the option -s "string" for the search strings
the option -r "string" for the replacement string
the -n option to prevent a backup file from being created
the -h option to print a usage statement and exit
The script will exit with an error status and print an error message:
if the -s option is not present.
if the -r option is not present.
if the string is not specified with the -s option
if the string is not specified with the -r option
if there are any other options specified
if there are no input files specified
if the input file cannot be read by the current process
if the input file cannot be written by the current process
if you cannot create the backup file.
Here is the usage statement for the script:
change-lines [-n] -s search string -r replace string files ...
-n do not backup the original file
-s search string the search for this string
-r replace string replace the search string with this string
-h print this message
Posted Date: 11/10/2012 9:10:45 PM | Location : United States
Ask an Expert
Unix Shell, Assignment Help, Ask Question on Unix Shell, Get Answer, Expert's Help, Unix Shell Discussions
Write discussion on Unix Shell
Your posts are moderated
Write your message here..
What is a stateless and and a stateful server, StatefulServer, maintains so...
StatefulServer, maintains some information between requests. Requires smaller messages, since some information is kept between contacts, example: FTP, telnet. Stateless Server req
Binary, Ask quwhat is binary estion #Minimum 100 words accepted#
Ask quwhat is binary estion #Minimum 100 words accepted#
Function, Function: The purpose of a function is to take in a number of v...
Function: The purpose of a function is to take in a number of values or arguments, do some calculations with those arguments and then return a single result. Each language has d
Write a long note on computer languages, Question 1 Explain the importan...
Question 1 Explain the importance of graphics in multimedia. What are few of the tips to keep in mind while using graphics for the web? Question 2 Write a long note on co
What is a tool bar?, Question 1 Write short notes on ...
Question 1 Write short notes on (a) Office Automatics System (b) Transaction Processing System Question 2 What is a too
Assignment, I have an assignment i need it to get it done How much would I...
I have an assignment i need it to get it done How much would I be charged for that?
Two-tiered architecture, Two-tiered architecture: This approach basic...
Two-tiered architecture: This approach basically introduced a database server to replace the file server. The emergence of relational database management systems and graphica
Multiple allocations, You can also allocate a single value to several varia...
You can also allocate a single value to several variables at the same time. For instance: X=y=z =1 Now, an integer object is generated with the value 1, and all three variables are
Internal structure of agents - artificial intelligence, I n t e rnal St...
I n t e rnal Structure of Agents We have looked at agents in terms of their external influences and behaviors: they take input from the environment and perform rational act
What are the three basic security provided by ssl, QUESTION (a) Can SSL...
QUESTION (a) Can SSL be used to encrypt email data? Justify your answer (b) What are the three basic security provided by SSL? (c) State the port number used by applicati
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
Why Us ?
~24x7 hrs Support
~Quality of Work
~Time on Delivery
~Privacy of Work
Human Resource Management
Literature Review Writing Help
Follow Us |
T & C
Copyright by ExpertsMind IT Educational Pvt. Ltd.