So that's an option to display statistics.
And if it's not printed some for cases where news doesn't specify extension open our script
and Firstly let's face displaying statistics we somehow need to tell all program what is a value of
variable status because we know that if that value is around him the user has requested statistics.
So before main or section referral out barometer the so right Desch the two AWC
and that barometer is filled with assignment of all variables.
That's where we can set the value of beshe variable stats.
So basically we created all the variable stats that if you put the value of beshi variable this could
be possible only thanks to using awk barometer Desch V.
So now we can in the end section ask if value of Stud's a variable is equals to 1.
So if that stat variable is equal to we can print Duzer some statistics.
So largest file you can print that largest file
is and it will be the value of variable Max name
and then we can bring in its size using Mock's of variable
and we could we can do that for megabytes.
And this same this will do for the smallest file which is meant name
and size is represented by a value of variable main
Now we have statistics barred.
So we need to also fix not displaying some for Casey's event.
No extension was specified by user Visi did we have if statement why are we asking if extension is existing.
And if yes we are counting some and counting.
What is the largest and smallest file.
So as this part of code we have written was only for case extension of our specified.
We need to write new code for case extension of Vohs not set.
So basically we can add a statement he says dead if statement above.
For a case extension was specified.
So pass output of ls l command for a specific location into our program where we select only files and
we don't need to pass this into our program we seven specific extension because we know that no extension
of all specified.
So just pass this into org very heavy using parameter.
We said value of all variables.
That's
And what will be in domain and and section of that program.
The counting will be the same as for previous OC command which specified extension.
So just copy debt levels part
and pasted into our section.
And that's pretty much all as accounting is the same.
So we just copied all gmane and section from previews awk it looks horribly because if you have same
code in two different places.
But for now it is just ok.
Yeah.
Or it will never end.
And we are looking at it.
But for now it is it is just OK.
So in order to do it we need to save our script Nahoum so save descript
and we can test it.
If I specify only a location with no extension
I got desired information gained.
And also would be really good to check if statistics can be displayed
and there's even if we didn't specify extension we see statistics grade even on the other hand specifies
some extent from
let's say the specify extension can.
It is working without any issue or script is basically dumb Only I don't like that we are using the
same code on different places.
So in this lecture we can fix it.