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

From: Ross Lagerwall <rosslagerwall_AT_gmail.com>
Date: Mon, 29 Apr 2013 14:15:16 +0100

On Sun, Apr 28, 2013 at 01:29:28PM +0000, Thorsten Glaser wrote:
> Peter Hofmann dixit:
>
> >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"} &
>
> Won't necessarily work if the result is not a simple command, though…
>
> FWIW:
>
> tg_AT_blau:~ $ cat >x1
> #!/bin/sh
> printf 'echo "Hello\tWorld!" | hexdump -C\n'
> tg_AT_blau:~ $ cat >x2
> #!/bin/sh
> eval exec "$(./x1)"
> tg_AT_blau:~ $ chmod +x x?
> tg_AT_blau:~ $ ./x2
> 00000000 48 65 6c 6c 6f 09 57 6f 72 6c 64 21 0a |Hello.World!.|
> 0000000d
>
> So the tab is kept when you put Ross’ suggestion into double quotes.
>

Would the following work in all the cases that we care about?
eval exec "$(dmenu_path | dmenu "$_AT_")"

-- 
Ross Lagerwall
Received on Mon Apr 29 2013 - 15:15:16 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 29 2013 - 15:24:05 CEST