Created
April 22, 2021 15:37
-
-
Save jkeam/cf337eba20b08b54054c83cf35b10df5 to your computer and use it in GitHub Desktop.
Open URL from the command line for MacOSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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