Subject: FVWM: .fvmrc undesired expansion of the $2 variable

From: Mauro Gargano <[email-masked]>
Date: Thu, 1 Jul 2004 13:09:20 +0200

Ciao,

I need to avoid the expansion of the string "$2" in the .fvwmrc file. 
This is a simple test scenario:

AddToMenu TT
+ "test" echo '$$2'

The desidered effect should be to write "$2" on the error-device but the
real effect is an empty string written to stderr.

can somebody help me?

thanks,
Mauro.

--
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: Scott Smedley <[email-masked]>
Date: Thu, 1 Jul 2004 22:29:43 +1000

> This is a simple test scenario:

I get precisely the behaviour you desire with your own command.
(ie. I can't reproduce the problem.) You probably want to leave off
the ' quotes though.

> real effect is an empty string written to stderr.

What version of FVWM are you using?

SCoTT. :)

---

From: Rusty Phillips <[email-masked]>
Date: Thu, 01 Jul 2004 07:55:23 -0500

It's being interpreted twice by the command:  once by test, and once by
the echo.
Test echo $$$$2

It worked for me.

---

From: Mauro Gargano <[email-masked]>
Date: Thu, 1 Jul 2004 16:21:43 +0200

Ciao SCoTT,

after your email I installed the version 2.4.18, but it didn't work.
But the Rusty's solution was fine.

Here a working kill menu:

AddToMenu Kill
+ "mo&zilla" Exec ps aux |  grep -P "(mozil|netsc|plugge)" | grep -v grep | awk '{print "kill -9 "$$$$2}' | sh
+ "&xmms"    Exec ps aux |  grep -P "xmms"                 | grep -v grep | awk '{print "kill -9 "$$$$2}' | sh
+ "m&player" Exec ps aux |  grep -P "mplayer"              | grep -v grep | awk '{print "kill -9 "$$$$2}' | sh    

Tanks to you all,
Mauro.

---

From: Scott Smedley <[email-masked]>
Date: Fri, 2 Jul 2004 11:22:04 +1000

Hi Mauro,

> after your email I installed the version 2.4.18, but it didn't work.

Strange. I'm using latest 2.5 (CVS). At least you've got it working.

> + "mo&zilla" Exec ps aux |  grep -P "(mozil|netsc|plugge)" | grep -v grep | awk '{print "kill -9 "$$$$2}' | sh

Are you using Linux? The "killall" command effectively does this.

SCoTT. :)

---

From: Thomas Adam <[email-masked]>
Date: Fri, 2 Jul 2004 02:30:45 +0100

On Fri, 2 Jul 2004 11:22:04 +1000

> Are you using Linux? The "killall" command effectively does this.

I'd suggest 'pkill' to avoid "killall" doing just that -- killing all
instances that might otherise want to be left running.

-- Thomas Adam

--
"Annie Hall leaves New York in the end. Press rewind, and Woody gets her
back again." -- "Look Inside America", Blur.

---

From: Mauro Gargano <[email-masked]>
Date: Fri, 2 Jul 2004 11:35:11 +0200

Ya, I'm using linux RH9.
The problem with killall is that it doesn't allow regular
expressions......And I didn't know the existence of "pgrep", "pkill" :-( .

Thanks you all,
Mauro.