PipeRead portability

I man fvwm, I can read:

and

If this really the case than ExecUseShell will not change the shell used by PipeRead, or do I have to assume than PipeRead will use the same shell than Exec, that is any shell defined by the user with ExecUseShell?

Dominique,

Your question has made me thought on the issue, but I do not have an answer. I have tried this:

ExecUseShell /bin/bash Exec exec gvim DestroyMenu HomeDirMenu AddToMenu HomeDirMenu "Home dir menu" Title PipeRead 'echo "+ $SHELL"'

In this test, gvim and $SHELL gives me zsh (my default shell). In my limited understanding, although ExecUseShell uses the specified shell, it does not change the value of $SHELL. Therefore, gvim and PipeRead are, in my case, using zsh.

Maybe you have a better way of testing it?

Cheers!

On gentoo, sh is a symlink to bash, so I installed zsh.

If I run in zsh:

P=PROGRAM; PROGRAM=xterm; ${(e)P:+\$$P} &

it launch xterm. With the same line in bash, I get:

bash: ${(e)P:+\$$P} : mauvaise substitution

In fvwm-crystal FvwmConsole:

Exec "P=PROGRAM; PROGRAM=xterm; ${(e)P:+\$$$P}"

give

/bin/sh: P=PROGRAM; PROGRAM=xterm; ${(e)P:+\$$P} : mauvaise substitution
PipeRead "P=PROGRAM; PROGRAM=xterm; \${(e)P:+\\\$\$P}"

give

sh: ${(e)P:+\$$P} : mauvaise substitution

With zsh:

ExecUseShell /bin/xsh Exec "P=PROGRAM; PROGRAM=xterm; ${(e)P:+\$$$P}"
give

zsh:1: command not found: P=PROGRAM; PROGRAM=xterm;

and

Exec "P=PROGRAM; PROGRAM=xterm; \${(e)P:+\\\$\$P}"

give

zsh:1: command not found: P=PROGRAM; PROGRAM=xterm; ${(e)P:+\$$P}

I am in zsh, but the command line is not working. I don’t understand why.

PipeRead "P=PROGRAM; PROGRAM=xterm; \${(e)P:+\\\$\$P}"

give

sh: ${(e)P:+\$$P} : mauvaise substitution

I am in sh, so ExecUseShell doesn’t seam to influence on PipeRead.

But it is more confusing. If I put the command line in a script without shebang (#!/bin/some_shell) and run it with Exec:

Exec $[HOME]/bin/testshell

give

/home/dom/bin/testshell: ligne1: ${(e)P:+\$$P} : mauvaise substitution

with ExecUseShell equal to both sh and zsh.

Correct. ExecUseShell only affects the Exec command.

– Thomas Adam