Skip to content

Instantly share code, notes, and snippets.

@mertcangokgoz
Last active August 10, 2016 15:39
Embed
What would you like to do?
Git.io: GitHub URL Shortener via console
#! /bin/bash
set -e
if [[ -z "$1" ]];
then
echo "Please enter a website url"
exit 1
else
if [[ -z "$2" ]];
then
echo "Please enter a custom url"
exit 1
else
echo "Please Wait..."
curl -s -i https://git.io -F "url=$1" -F "code=$2" | awk '/Location/ {print $2}'
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment