Question: ( 3 0 Points ) Write a complete bash script called euidA. sh ( where euid is your EUID ) : Define a function called

(30 Points) Write a complete bash script called euidA. sh (where "euid" is your EUID):
Define a function called average that accepts two parameters: the first parameter is the
sum of all the integers passed in to the bash script (as command-line arguments), while
the second parameter is the number of integers passed in to the bash script.
If the number of parameters passed into the function is equal to 2, compute the
average using the two parameters passed to the function, and then print out a
meaningful message that includes the number of integers passed in to the bash script
and the integer average of those integers. Note that this only asks for an "integer
average", not a floating-point accurate average.
In the main part of the bash script:
If one or more integers are passed in to the bash script, you will
initialize two variables sum and count to 0,
use a loop to keep a running sum and count of the integers passed in to the bash
script, and
call the function average, passing sum and count as parameters to the
function. Note that you may assume that if the user passes any parameters to the
bash script that they are integers.
Otherwise, if no integers are passed to the bash script, you will
redirect the output of the Linux date command to a file called date. txt,
write a one-line gawk command such that if the minutes portion of the time from
the date command (written to the date.txt filc) is less than 30 minutes, you
will print out the minutes followed by the text "minutes past the hour", and
if the date.txt file is readable by the process, then output the number of lines,
words and characters/bytes contained in the file to the terminal. Hint: There is a
Linux command that does this very easily.
Please put your name in comments in the program file, but due to time constraints, other
comments are not required in this script file.
SAMPLE OUTPUT (user input in bold):
$ date (This command only used to show time for understanding purposes only.)
Sun Feb 2418:16:29 CST 2019
$./mat0299A.sh
16 minutes past the hour
1629 date.txt
$ date (This command only used to show time for understanding purposes only.)
Sun Feb 2418:33:48 CST 2019
$./mat0299A.sh
1629 date.txt
$./mat0299.sh 5
The average of 1 numbers is 5
$ ./mat0299.sh 510
The average of 2 numbers is 7
$ ./mat0299.sh 510,15,20,25
The average of 5 numbers is 15.
 (30 Points) Write a complete bash script called euidA. sh (where

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!