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..
Unix shell and history problem, UNIX Shell and History feature. 1.Creating ...
UNIX Shell and History feature. 1.Creating a child process. 2.Creating a history feature. Its exactly "programming project 1 - Unix Shell and History Feature (p.157-159)" in the Si
Differentiate the client–server and peer-to-peer models of d, The client-se...
The client-server model firmly differentiates the roles of the client and server. According to this model, the client requests services that are provided by the server. The peer-to
Instructions for cycles: loop, They transfer the process flow, provisionall...
They transfer the process flow, provisionally or totally, to a destiny, replicating this action until the counter is zero. LOOP LOOPE LOOPNE LOOP INSTRUCTION reason: To produce a c
Describe 3 components of a pattern, QUESTION (a) Compare the adapter pa...
QUESTION (a) Compare the adapter pattern with the façade and decorator patterns. (b) Illustrate a two-way adapter pattern. (c) Describe 3 components of a pattern. (d)
Explain the important features of creational patterns, Question 1 Explain ...
Question 1 Explain the role of object oriented designers in developing a software system Question 2 What are the four essential elements of design patterns? Explain Question 3
Information management, assignment
Evolution of a computer, EVOLUTION OF A COMPUTER: Although 'computer',...
EVOLUTION OF A COMPUTER: Although 'computer', as we understand it today, is relatively of recent innovation, its development rests on centuries' of research. This section pres
Pseudocode, How Much Insurance? Many financial experts advise that property...
How Much Insurance? Many financial experts advise that property owners should insure their homes or buildings for at least 80 percent of the amount it would cost to replace the st
Working of web browser, Working of web Browser: Internet is character...
Working of web Browser: Internet is characterized by the Client Server Computing that consists of three basic components: The Web client which may be the web browser;
Socket, socket programming
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.