Skip to content

Instantly share code, notes, and snippets.

@vrs
Created November 26, 2014 12:35
#!/bin/bash
if [[ $1 =~ ^http ]]; then #http, https
url=$1
else # everything else
url="http://$1"
fi
escaped=$(perl -MURI::Escape -e 'print uri_escape($ARGV[0], "(),");' "$url")
firefox -P default -remote "openURL(${escaped}, new-tab)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment