Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Purpose of this Assignment The purpose of this experiment is to invoke an awk script from a shell script. In this assignment, your shell script
Purpose of this Assignment The purpose of this experiment is to invoke an awk script from a shell script. 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 awk, awk, which can be used for both files above. awklawk partitions a date value formatted as in file1.txt and file txt into day, month and year fields and appends these fields to out1.txt. Example: When file1 ixt is input to dwl.awk, the contents of oull.txt become as given below: 15 8 3 10 6 12 2017 2010 2011 20 ASW OC After executing awk l. awk to process file2.ixi. outlixt becomesi 15 10 2017 8 6 2010 12 2011 12 12 2013 6 2005 18 4 2014 Hence, you will invoke awki.awk twice in your shell script: Once for filel.txt and once for file2.txt. Step 2: You will create awk2.awk, which processes outl.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 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started