Skip to content

Instantly share code, notes, and snippets.

@jkeam
Created April 22, 2021 15:37
Show Gist options
  • Save jkeam/cf337eba20b08b54054c83cf35b10df5 to your computer and use it in GitHub Desktop.
Save jkeam/cf337eba20b08b54054c83cf35b10df5 to your computer and use it in GitHub Desktop.
Open URL from the command line for MacOSX
#!/bin/bash
# Taken from: https://superuser.com/questions/153245/how-can-i-open-google-chrome-via-command-line-with-a-url-in-incognito-mode
url() {
url=$([[ $1 =~ ^[a-zA-Z]{1,}: ]] && printf '%s\n' "$1" || printf '%s\n' "http://$1")
open -a 'Google Chrome' "$url"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment