[openbox] Problem with bash script in Openbox menu

Ian Zimmerman itz at buug.org
Fri Sep 20 01:54:00 EDT 2013


On Sun, 15 Sep 2013 21:50:48 +0100
David Shaw <dj.shaw at btconnect.com> wrote:

Dana> The '.' command won't search your path. You can probably replace
Dana> '.'  with 'exec' (or just with nothing) and then not need the full
Dana> path.

David> I did not know that, thank you.  However, it doesn't explain why
David> the script *will* work as intended from the terminal, but *won't*
David> from the openbox menu or gmrun unless I include the full path to
David> the script, no matter how it's run, with or without a . or with
David> exec.

From "man bash":

 .  filename [arguments]
 source filename [arguments]

 Read and execute commands from filename in the current shell
 environment and return the exit status of the last command executed
 from filename.  If filename does not contain a slash, file names in
 PATH are used to find the directory containing filename.  The file
 searched for in PATH need not be executable.  When bash is not in posix
 mode, the current directory is searched if no file is found in PATH.
 If the sourcepath option to the shopt builtin command is turned off,
 the PATH is not searched.  If any arguments are supplied, they become
 the positional parameters when filename is executed.  Otherwise the
 positional parameters are unchanged.  The return status is the status
 of the last command exited within the script (0 if no commands are
 executed), and false if filename is not found or cannot be read.

I am guessing that your .bashrc script turns the sourcepath flag on,
and then it is in effect in every interactive shell you start, but not
in scripts.

-- 
Please *no* private copies of mailing list or newsgroup messages.

gpg public key: 1024D/C6FF61AD
fingerprint: 66DC D68F 5C1B 4D71 2EE5  BD03 8A00 786C C6FF 61AD
Funny pic: http://bit.ly/ZNE2MX


More information about the openbox mailing list