I have a script /usr/local/bin/foo that opens an app with command line arguments:
#!/bin/bash
open -a Foo.app --args $@
The problem is, when I run
foo bar.txt
the result is Foo.app opens and tells me bar.txt cannot be found.
However,
foo /absolute/path/to/bar.txt
works as expected.
Is there a simple way to automatically pass absolute paths to the --args option of the open command?