I would like to understand the function of * in the if statement as follow:
if [[ '/bin/somecommand 2>dev/null' ! = *'1'* ]];
is to examininate if the return value is return as 1, but if I leave it as
if [[ '/bin/somecommand 2>dev/null' ! = '1' ]];
it will not examinate proper value. I just try to understand what is the function of the * at the front and back of '1' does it make it a integer for comparison purpose?
I have tried the following combination
if [[ '/bin/somecommand 2>dev/null' ! = '1' ]];
if [[ '/bin/somecommand 2>dev/null' ! = 1 ]];
None of the way would return the right result other than the first one with * at the front and back of the '1'.