Last active
January 3, 2016 08:39
-
-
Save coderofsalvation/8437817 to your computer and use it in GitHub Desktop.
checks if argument is an url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # checks if argument is an url | |
| # usage: is_url "http://foo.com" && echo "yes im an url" | |
| # @param string | |
| is_url(){ | |
| [[ "$1" =~ ^http ]] && return 0 || return 1 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment