I have a value in a variable that may be absolute or relative url, and I need to check which one it is.
I have found that there's a =~
operator in [[
, but I can't get it to work. What am I doing wrong?
url="http://test"
if [[ "$url" =~ "^http://" ]];
then echo "absolute.";
fi;