[GRASS-dev] d.vect.thematic problem

Earlier today, I reported that d.vect.thematic is not running on my Mac, returning the error

csh: if: Expression Syntax.
d.vect.thematic: awk required, please install awk or gawk first

The code in d.vect.thematic that is causing this is the following…

check if we have awk

if [ ! -x “which awk” ] ; then
echo “$PROG: awk required, please install awk or gawk first” 2>&1
exit 1
fi

If I run…

which awk

…from the a plain vanilla bash Terminal.app window, it returns …

/usr/bin/awk

But if I run it from the GRASS Terminal.app window, it returns…

csh: if: Expression Syntax.

This is with William Kyngesburye’s binaries of 2 Sept. 2006. Any idea what’s wrong?

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

d.vect.thematic works for me. If I change that awk check to something that doesn't exist, I get the expected 'awk required' error. No syntax error.

And, awk itself from the GRASS Terminal works for me. What's your PATH in GRASS at the time you want to run d.vect.thematic? Even without the user adding anything to the PATH in their bash startup, /usr/bin should be in their PATH.

On Sep 11, 2006, at 3:41 PM, Michael Barton wrote:

Earlier today, I reported that d.vect.thematic is not running on my Mac, returning the error

csh: if: Expression Syntax.
d.vect.thematic: awk required, please install awk or gawk first

The code in d.vect.thematic that is causing this is the following...

#### check if we have awk
if [ ! -x "`which awk`" ] ; then
    echo "$PROG: awk required, please install awk or gawk first" 2>&1
    exit 1
fi

If I run...

>>which awk

...from the a plain vanilla bash Terminal.app window, it returns ...

/usr/bin/awk

But if I run it from the GRASS Terminal.app window, it returns...

csh: if: Expression Syntax.

This is with William Kyngesburye’s binaries of 2 Sept. 2006. Any idea what’s wrong?

-----
William Kyngesburye <kyngchaos@kyngchaos.com>
http://www.kyngchaos.com/

All generalizations are dangerous, even this one.

It IS a path problem. It is getting set incorrectly, without
/usr/bin:/usr/local/bin...etc.

GRASS 6.3.cvs (spearfish60_test):~ > $PATH
bash:
/Applications/Grass/GRASS.app/Contents/Resources/bin:/Applications/Grass/GRA
SS.app/Contents/Resources/scripts::/Users/cmbarton/Library/Application: No
such file or directory

I set it manually and all works. Any thoughts?

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: William Kyngesburye <woklist@kyngchaos.com>
Reply-To: William Kyngesburye <kyngchaos@kyngchaos.com>
Date: Mon, 11 Sep 2006 16:15:55 -0500
To: Michael Barton <michael.barton@asu.edu>
Cc: <grass-dev@grass.itc.it>
Subject: Re: [GRASS-dev] d.vect.thematic problem

d.vect.thematic works for me. If I change that awk check to
something that doesn't exist, I get the expected 'awk required'
error. No syntax error.

And, awk itself from the GRASS Terminal works for me. What's your
PATH in GRASS at the time you want to run d.vect.thematic? Even
without the user adding anything to the PATH in their bash startup, /
usr/bin should be in their PATH.

On Sep 11, 2006, at 3:41 PM, Michael Barton wrote:

Earlier today, I reported that d.vect.thematic is not running on my
Mac, returning the error

csh: if: Expression Syntax.
d.vect.thematic: awk required, please install awk or gawk first

The code in d.vect.thematic that is causing this is the following...

#### check if we have awk
if [ ! -x "`which awk`" ] ; then
    echo "$PROG: awk required, please install awk or gawk first" 2>&1
    exit 1
fi

If I run...

which awk

...from the a plain vanilla bash Terminal.app window, it returns ...

/usr/bin/awk

But if I run it from the GRASS Terminal.app window, it returns...

csh: if: Expression Syntax.

This is with William Kyngesburye¹s binaries of 2 Sept. 2006. Any
idea what¹s wrong?

-----
William Kyngesburye <kyngchaos@kyngchaos.com>
http://www.kyngchaos.com/

All generalizations are dangerous, even this one.

Hmm, that's not a good way to look at the PATH - it's trying to execute it as a command. And the rest is getting cut off at the Application Support part - there's a space in there breaking it up.

Try echo $PATH, or env to get everything in the environment.

On Sep 11, 2006, at 4:22 PM, Michael Barton wrote:

It IS a path problem. It is getting set incorrectly, without
/usr/bin:/usr/local/bin...etc.

GRASS 6.3.cvs (spearfish60_test):~ > $PATH
bash:
/Applications/Grass/GRASS.app/Contents/Resources/bin:/Applications/Grass/GRA
SS.app/Contents/Resources/scripts::/Users/cmbarton/Library/Application: No
such file or directory

I set it manually and all works. Any thoughts?

-----
William Kyngesburye <kyngchaos@kyngchaos.com>
http://www.kyngchaos.com/

"We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war