Re: FVWM: PipeRead and shell args

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Tue, 13 Aug 2002 19:13:14 +0000

On 13 Aug 2002 12:18:15 -0600, Gregg Dameron wrote:
>
> I have a function that accepts three arguments, the last of which is
> optional; if omitted, I supply a default. Here's what's working:
>
> AddToFunc MyFunc
> + I PipeRead 'BD=$2; BD=${BD:-4}; ... '
>
> If I try to shorten it to this:
>
> + I PipeRead 'BD=${2:-4}; ... '
>
> then BD is always 4 ($2 is seemingly ignored). "sh" is apparently
> satisfied (no "bad substitution" error). Expected? Wrong syntax?

You can't shorten it. If you want the second function parameter to be
expanded by FVWM, you should write it as $2. Other shell-like syntaxes
like ${2} or ${2:-4} do not work, both these strings are passed to the
shell unexpanded if used inside PipeRead.

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Aug 13 2002 - 14:14:29 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:53 BST