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..
Autonomous rational agents - artificial intelligence, A utonomous Rational...
A utonomous Rational Agents: In many cases, it is not accurate to talk about a particular program or a particular robot, as the combination of and software and hardware in so
Choice of medium - transmission channels, Choice of Medium: All the tr...
Choice of Medium: All the transmission channels discussed in the foregoing paragraphs can be used as point to point connections or as broadcast systems. Transmitting informati
Data Mining Assignment (by Weka), Hi there, I''m just asking that do you d...
Hi there, I''m just asking that do you do data mining assignment?
Computer, what is the computer science
what is the computer science
Visual Basic 2012, Can someone help me write a code for force = mass * acce...
Can someone help me write a code for force = mass * acceleration.
What do you mean by geo stationary orbit, Question 1 . Explain (a) Scatter ...
Question 1 . Explain (a) Scatter loss (b) Aperture medium coupling loss Question 2 . What do you mean by Geo stationary orbit? Question
Command processor and user interface, Command Processor and User Interface:...
Command Processor and User Interface: To the user, the most important and visible services provided by the OS is the user interface and the capabilities that it provides to ex
Management information system, suggest 5 ways by which new products and ser...
suggest 5 ways by which new products and services can be developed using management information system
Block matching algorithm, I am using block matching algorithm to get the mo...
I am using block matching algorithm to get the motion vectors, now, how can I get the depth map/depth value from the motion vectors?
Data communication & net centric computing, Suppose there are exactly five ...
Suppose there are exactly five packet switches (Figure 4) between a sending host and a receiving host connected by a virtual circuit line (shown as dotted line in figure 4). The tr
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
IT Courses and 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.