Question: BASH Using only pure BASH (python, bc, awk, etc are NOT allowed!) , write a function called mean that will take one matrix with an
BASH
Using only pure BASH (python, bc, awk, etc are NOT allowed!), write a function called mean that will take one matrix with an unknown number of rows and columns. The function must find the mean of all the numbers in each column and return the mean in a single row. The means will be seperated by tabs.
The input matrix will be integers seperated by tabs:
1\t2\t3
4\t5\t6
7\t8\t9
Given a sample matrix:

After running our program, we get:

The output is seperated by tabs.
The input must be a matrix of unknown size and this script must return the mean of the columns as seen above.
AWK, Python, and other embedded languages are not allowed.
$ cat m1 1 5 2 4 7 $ cat m1 1 5 2 4 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
