Error in server memory

I have wrote the command to extract memory total which is working fine in my linux terminal and giving the output,but when i am writing it in shell its showing
“Incorrect invocation of script. Usage: ./check_QBox_server_memory.sh /proc/meminfo”
ps: 1.i have used backticks,
2.used the command to extract the integer value only
???

may be you did some syntax mistakes while pasting command in bash script and make sure you did not given any space while assigning command to variable.

sir,
I don’t think there can be any syntax mistake because it is correct in terminal and also i removed all white spaces , sir one more thing just for checking i hard coded the value of variable from proc/meminfo file instead of writing the command, still its showing the same error

i am quite sure now you are making some syntax mistake because if its command syntax mistake it should work in hardcode case but still there is a syntax mistake that’s why its showing this error again and again

thank you sir, its done now.

1 Like

I am facing the same issue it is working fine in my terminal but build is failing for check_QBox_server_memory.sh only.

I am getting the same error and even i checked the syntax it works fine in the terminal can you help?

hint: figure out why # is being used in your .sh file

it is used for comment
i am using vmstat but i am getting “Incorrect invocation of script. Usage: ./check_QBox_server_memory.sh /proc/meminfo” as error