Skip to content

Instantly share code, notes, and snippets.

@delta1
Created January 8, 2021 07:14
Show Gist options
  • Save delta1/8ffc61200b650ab471e83f008645b01c to your computer and use it in GitHub Desktop.
Save delta1/8ffc61200b650ab471e83f008645b01c to your computer and use it in GitHub Desktop.
macos `open` command not passing arguments via `--args`
#!/bin/zsh
# make this executable with `chmod +x ./bug.sh`
#
LS=$(which ls)
open -a terminal $LS --args -l
# ls will open in a new terminal, but the `-l` argument is not passed to it
# terminal only runs `/bin/ls ; exit;`
@delta1
Copy link
Author

delta1 commented Jan 8, 2021

@delta1
Copy link
Author

delta1 commented Jan 8, 2021

this ugly hack may do it https://stackoverflow.com/a/29511052

@delta1
Copy link
Author

delta1 commented Jan 8, 2021

shell scripting is fun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment