This script will short any URL you want, using the Git.io shortener service API.
(Remember to use chmod +x to give the script execution privileges)
Just call the script and pass the desired URL as an argument. The shortened URL will be returned, if no errors happened.
$ ./shotener.sh https://www.github.com
https://git.io/vDN6Ig