Rate this product
- script1.sh:Write a sed command/script to emulate wc -l command. This file is run as a bash script by typing : . script1.sh filename.txt
- script2.sedWrite a sed script which takes an input file and puts a line number at the beginning of each line.This file is run as a bash script by typing : . script2.sh filename.txt For example :input.txt has the following contents:this is first linethis is third line this is fourth line.1
should be written to output.txt as follows: See that all blank lines also get a number.(1) this is first line
(2)(3) this is third line
(4)
this is fourth line
3. script3.sed:Given input files contains new-lines and white spaces and tabs. Write a sed script to
- (a) Remove all leading spaces
- (b) Collapse every sequence of white spaces between two words in a single line into a single space, and
- (c) Collapse every sequence of white spaces between two lines into a single newline. All other suffix and prefix whitespaces are to be deleted.
- (d) Print the output to screen. For example
how are you
fine.
becomes
how are you fine.
4. script4.sed :There is a text file called input.txt such that there are four strings on each line.
For example:
VeenaDaniel Raj 3456 Veena Michael Raj3456
2
This has to be written so that all four fields in the record (line) are sepa- rated by a single tab. Therefore above output looks like

![[Solved] CS213 Assignment 9 -Sed](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] CS213 Assignment 5 Part 2-PHP2 part 2 statement](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.