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..
Cache memory, Cache memory: To reduce the idle time of the CPU and inc...
Cache memory: To reduce the idle time of the CPU and increase the speed of processing, a fast memory can be used. This can be done by using a large size of main memory. But th
Trap doors and Logic Bombs, Trap doors: This is a way of bypassing normal...
Trap doors: This is a way of bypassing normal authentication procedure (windows/ operating system user name and password) to access a system. Once a system is compromised (impac
Cpu, what is cpu
what is cpu
Comparison instructions , They are used to evaluate operators, and they hav...
They are used to evaluate operators, and they have an effect on the content of the flags. CMP CMPS (CMPSB) (CMPSW) CMP INSTRUCTION Idea: To measure up to the operators. Syntax: CMP
Client - server architecture, Client/ Server Architecture: As the ca...
Client/ Server Architecture: As the capacity and power of personal computers improved, the need to share the processing demands between the host server and the client workst
Digital, define complement?
Traditional business cycle, what is traditional business cycle
what is traditional business cycle
Opening documents situated on different computers - network, Opening Docume...
Opening Documents Situated on Different Computers In order to work with documents situated on other computers, you need sufficient rights to access the folder in which it is
Three specific sections of the microprocessor, • CPU Structure This section...
• CPU Structure This section, with a simplified model of a central processing unit as an instance, takes you through the role of each of the major basic parts of the CPU. It also l
Input Devices, Keyboards, microphones, and mice have generally been used as...
Keyboards, microphones, and mice have generally been used as the standard input devices for most computer systems. The popularity of video and computer games has led to the introdu
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.