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