Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

In this assignment, your shell script will input two command line arguments, which will be file names. An example for these files are given below:

image text in transcribedimage text in transcribed

In this assignment, your shell script will input two command line arguments, which will be file names. An example for these files are given below: file1.txt: 15/10/2017 8/6/2010 3/12/2011 file2.txt: 12/12/2013 4/6/2005 18/4/2014 Step 1: You will create awkl.awk, which can be used for both files above. awkl.awk partitions a date value formatted as in file1.txt and file2.txt into day, month and year fields and appends these fields to outl.txt. Example: When file1.txt is input to awkl.awk, the contents of out1.txt become as given below: 15 8 3 10 6 12 2017 2010 2011 un After executing awkl.awk to process file2.txt, out1.txt becomes: 15 10 2017 8 6 2010 3 12 2011 12 12 2013 4 6 2005 18 4 2014 Hence, you will invoke awk1.awk twice in your shell script: Once for filel.txt and once for file2.txt. Step 2: You will create awk2.awk, which processes out1.txt. In awk2.awk, print the even numbered lines existing in outl.txt, which are given as bold in the example above. After completing step 1, execute awk2.awk in your shell script. When your shell script completes execution, the output will be 8 12 18 6 12 4 2010 2013 2014 You will have a single shell script

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions