Subject: FVWM: How is SetEnv evaluated?

From: Victor Eijkhout <[email-masked]>
Date: Tue, 1 Oct 2002 20:50:14 -0400

Can I use the usual expansions? I would like to do something like

SetEnv x `$(( $[x] + 1 ))`

-- 
Victor Eijkhout <[email-masked]>
tel: 865 974 9308 (W), 865 673 6998 (H), 865 974 8296 (F)
http://www.cs.utk.edu/~eijkhout/
--
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: Victor Eijkhout <[email-masked]>
Date: Tue, 1 Oct 2002 21:00:39 -0400

>SetEnv x `$(( $[x] + 1 ))`

PipeRead 'echo "SetEnv x $(( $[x] + 1 )) " '

(Posting a question increases your chances of finding the answer 
yourself by at least 500%)

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 2 Oct 2002 01:11:38 +0000

> SetEnv x `$(( $[x] + 1 ))`

SetEnv gets 2 strings, the first is the name and the second is the value.
You should use PipeRead, but the environment of the child does not affect
the parent fvwm process, so you should do something like:

  PipeRead 'echo SetEnv x `$(( $[x] + 1 ))`'

Or better yet use FvwmPerl instead (if you use 2.5.x) after running it:

  SendToModule FvwmPerl eval $a = 2
  SendToModule FvwmPerl eval $a += 8
  SendToModule FvwmPerl eval for (1 .. $a) { command("Exec xterm -n $_") }

But be aware that $x (unlike $a) is substitued by fvwm, see the man page.

Regards,
Mikhael.