Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have a question about a program I'm writing on the Bash shell. I have the following two files: My source code looks like this:

I have a question about a program I'm writing on the Bash shell.

I have the following two files:

image text in transcribed

My source code looks like this:

image text in transcribed

And my output looks like this:

image text in transcribed

The first two numbers, 2, 4 are correct because "m1" has 2 rows and 4 columns.

However, the third and fourth numbers are incorrect because "m2" has 4 rows and 2 columns.

Can anyone tell my why the output is incorrect?

Thanks!

osl/cs344/blockl 961$ cat ml 2 7 osl /cs344/blockl 9629 cat m2 osl /cs344/blockl 963$ if [ $# -eq 3 ] then argl-s2 arg2-$3 fi numRowsl- numRows2O #numColsi-$(head-n1 $arg1 I wc -w) #numCos2-$(head-n1 $arg2 | wc -w) while read currLinel

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

6. Conclusion:

Answered: 1 week ago