In the Set Run Action window (and associated Information window), might
I suggest using "$@" by default instead of "$1"? The reason for this is
very subtle, but nontheless:
in bash (or sh), if $# == 0, "$@" will expand to absolutely nothing.
However, when $# is 0, "$1" expands to "" (empty string). This confuses
programs and the people running them. :) Granted under normal
circumstances these run-action scripts will be run by the filer and
hence have a non-empty string argument, if a user runs a run-action
script directly (to see what it does, etc) with no arguments (either by
click in the filer or on command line), it should "behave as expected".
Try this with xv if you have it (which I use for most image viewing).
kw@...:~$ echo $#
kw@...:~$ # ok good. no arguments. :)
kw@...:~$ xv "$@"
kw@...:~$ # behaves "as expected"; same as launching xv w/ no args
kw@...:~$ xv "$1"
kw@...:~$ # gives a confusing warning: "Warning: Couldn't read all
of '/home/kw'. Possibly truncated." when trying to open file "".
Get latest updates about Open Source Projects, Conferences and News.