Subject: FVWM: PipeRead and shell args

From: Gregg Dameron <[email-masked]>
Date: Tue, 13 Aug 2002 12:18:15 -0600

Running 2.4.7 on Solaris.

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?

Gregg Dameron

--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 13 Aug 2002 19:13:14 +0000

> 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.