I would like to use a simple "if then" test to check if an argument to a command begins with "http://" as follows:
if [[ $2 == [url]http://*[/url] ]]; then
but the wildcard just seems to be ignored, ie., it will only execute the command if the expression is strictly "http://" with nothing following it. I have tried enclosing the second expression with single and double quotes, and have tried using various wildcards such as ".", "?", ".*", etc. to no avail.
Done much searching on the web; the only thing I found referring to the use of wildcards in testing is in using the "test" command, of which it said you could not do so. Is this the case also with "if then" tests? Is there a way to implement wildcard testing using this command?