Re: [wmii] Wmii Script does not work

From: Kris Maglione <maglione.k_AT_gmail.com>
Date: Sun, 25 Jan 2009 14:29:04 -0500

On Sun, Jan 25, 2009 at 09:59:25AM -0800, Manuel Rotter wrote:
>...
> for i in 0 1 2 3 4 5 6 7 8 9; do
> cat <<!
> Key $MODKEY-$i
> if [ `wmiir read /ctl | grep ^view | cut -f 2 -d ' '` == "$i" ]
> then
> wmiir xwrite /tag/sel/ctl select up
> else
> wmiir xwrite /ctl view "$i"
> fi
> Key $MODKEY-Shift-$i
> wmiir xwrite /client/sel/tags "$i"
>...

You have to escape the backticks. Try using $(...) instead and
escape the $.

Oh, and i'd just use awk:

   wmiir read /ctl | awk '$1 == "view" { print $2 }'

(though you already have $(wi_readctl view) to do that).

-- 
Kris Maglione
If the facts don't fit the theory, change the facts.
	--Albert Einstein
Received on Sun Jan 25 2009 - 19:29:04 UTC

This archive was generated by hypermail 2.2.0 : Sun Jan 25 2009 - 19:36:07 UTC