Post Closed as "duplicate" by Jeff Schaller, steeldriver, Thomas Dickey, Stephen Rauch, G-Man of
2 added 11 characters in body
source | link

I believe this line

if test "$suman_inspect" -eq "yes"; then

is causing this error (verbatim):

bash: test: no: integer expression expected

I formulated the above test expression because I saw this example online:

 if test "$#" -eq "0"; then

where this test checks to see if the length of the arguments array is 0.

So is there something wrong with both these checks? I am not sure I understand how the first could be valid but the second one invalid.

I believe this line

if test "$suman_inspect" -eq "yes"; then

is causing this error:

bash: test: no: integer expression expected

I formulated the above test expression because I saw this example online:

 if test "$#" -eq "0"; then

where this test checks to see if the length of the arguments array is 0.

So is there something wrong with both these checks? I am not sure I understand how the first could be valid but the second one invalid.

I believe this line

if test "$suman_inspect" -eq "yes"; then

is causing this error (verbatim):

bash: test: no: integer expression expected

I formulated the above test expression because I saw this example online:

 if test "$#" -eq "0"; then

where this test checks to see if the length of the arguments array is 0.

So is there something wrong with both these checks? I am not sure I understand how the first could be valid but the second one invalid.

1
source | link

bash: test: no: integer expression expected

I believe this line

if test "$suman_inspect" -eq "yes"; then

is causing this error:

bash: test: no: integer expression expected

I formulated the above test expression because I saw this example online:

 if test "$#" -eq "0"; then

where this test checks to see if the length of the arguments array is 0.

So is there something wrong with both these checks? I am not sure I understand how the first could be valid but the second one invalid.