Skip to content

Instantly share code, notes, and snippets.

@vrs
Created November 26, 2014 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vrs/e8ac140bb6b9e50bfbc2 to your computer and use it in GitHub Desktop.
Save vrs/e8ac140bb6b9e50bfbc2 to your computer and use it in GitHub Desktop.
#!/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