Re: [dev] [PATCH v3] dmenu_run: Don't leave a shell running

From: Peter Hofmann <suckless-dev-list_AT_uninformativ.de>
Date: Sun, 28 Apr 2013 09:36:22 +0200

Hi,

On Sat, Apr 27, 2013 at 10:15:12PM +0100, Ross Lagerwall wrote:
> If you type: a\ b "c d" e
> then it will try and execute the program "a b" and pass it two arguments,
> "c d" and "e".

that might work, but something like this won't:

        xterm -hold -e bash -c 'echo "hello world"'

The "hello world" will collapse to "hello world".

I believe you can work around all these issues by simply prefixing the
command piped to the shell with an "exec":

        dmenu_path | dmenu "$_AT_" | sed 's/^/exec /' | ${SHELL:-"/bin/sh"} &

This way, any evaluation of quotes or spaces or $whatever by dmenu_run
itself is avoided.

Cheers,
Peter

Received on Sun Apr 28 2013 - 09:36:22 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 28 2013 - 09:48:05 CEST