Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Drop-in cross-platform OSX “open” functionality
# Cross-platform Darwin open(1)
# Simply add this function definition above any OSX script that uses the “open” command
# For additional information on the “open” command, see
open() {
if [[ $(uname) = "Darwin" ]]
then /usr/bin/open "$@" #OS X
else xdg-open "$@" &> /dev/null & # credit:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment