Re: FVWM: question: Fvwm and Awk: more $1 expansion trouble

From: Neil Zanella <nzanella_at_cs.mun.ca>
Date: Sun, 28 Jan 2001 17:28:48 -0330 (NST)

Thanks Dominik for your comments. I got the script to work by
removing the parentheses and testing it first on the command line,
then within a subshell, then within an xterm that runs the subshell,
and finally through an Fvwm menu and by running ps aux | grep awk
I could debug the line in the fvwm script while my xterm was drunk.

Here is the line I eventually got to work in my .fvwm2rc file.
My mail client broke it all up but that's OK...

+ "RGB" Exec /usr/X11R6/bin/xterm -e /bin/sh -c
'/usr/X11R6/bin/showrgb | /bin/awk "{ printf(\"#%02X%02X%02X\t\", \$$$$1,
\$$$$2, \$$$$3); for (i = 4; i <= NF; i++) printf \" \" \$i; print
\"\" }" | /usr/bin/less'

It's a bit messy but at least I don't have to keep track of external
scripts! 8-)

Have a nice day,

Neil

On Sun, 28 Jan 2001, Dominik Vogt wrote:

> Just to give you an idea why this is so complicated: This line
> is executed as a normal fvwm command that adds a new item to a
> complex function that executes an xterm command that starts a
> shell to run a script that runs a pipe which includes an awk
> script that prints positional parameters with a format mask.
> If my count is correct, quotes, '|' symbols and '$' are
> interpreted up to eight times by at least four different parsers
> (fvwm, sh, awk and xterm) in this chain. Each of these parsers
> has a different idea how things work. In this situation it is
> almost always better to get these commands straight on the command
> line, then put them in a shell script and execute the script from
> the function.


--
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 Sun Jan 28 2001 - 14:58:13 GMT

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