/proc/meminfo works on CLI but can't "cat" it in .sh file, in module 2

$: ./check_QBox_server_memory.sh /proc/meminfo
./check_QBox_server_memory.sh: line 23: /proc/meminfo: Permission denied
./check_QBox_server_memory.sh: line 25: test: -ge: unary operator expected
Error: Total Memory of KB is insufficient for QBox

the file meminfo can be easily read and greped from command line but it can’t even find the file when i run it in the script, is it a permission issue or is it anything else?

and please suggest a remedy

Thanks in Advance


  1. Did you gave necessary permissions to that file (i.e via chmod)
  2. Hope you are using cat $1 and then passing /proc/meminfo as the command line argument.

getting the same error.

check backticks and whitespaces