Meaning of line in TODO?

Start the expression to populate the variable with “cat $1” which is the command line filename input. Check the Usage above.
What is the meaning of above line in TODO?

make the variable equal to that command, then execute the script with an argument that is the filename.

When I am executing the script, below error is coming…
“Incorrect invocation of script. Usage: ./ /proc/meminfo”

try using awk command

Can you explain more about this?

Are you extracting just the numeric part of MemTotal or the whole thing?

I just want to know what is the need to use cat command here?

Using cat command you need to pass the file name as argument while executing

To access /proc/meminfo?

use /proc/meminfo as argument

Thanks Buddy, I got it!

$1 is the first argument of that script which is passed during the execution.
Detail explanation here

1 Like

What is the return type of command ‘grep MemTotal /proc/meminfo’?
Is it string ?

check the manual entry about grep you’ll get it