0
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?
I would guess this fails with whitespace on the path – slhck – 2014-10-23T15:54:43.123
yes. realpath does not like whitespace :( – willpett – 2014-10-24T16:28:24.840
No, it's probably solvable by quoting it right, but I don't know by just looking at it where to put them :) – slhck – 2014-10-24T16:47:48.603