[GRASSLIST:10784] awk not found on Mac osx, Repost

I posted this some time ago. Markus responded with a change which has been incorporated into CVS code.

However, this hasn’t helped things for me as I still am getting a problem with “awk required”

I am using 6.1 CVS with Lorenzo’s binaries (06 March 06 ) on a macintosh OS 10.4.

When I try to add a database column I get:

v.db.addcol map=CondieHead layer=1 ‘columns=Elev varchar(10)’
csh: /sw/bin/init.csh: No such file or directory.
: awk required, please install awk/gawk first

This suggests awk is absent. When I invoke awk from the grass command line, I get:

GRASS 6.1.cvs (SaskNad83UTM) > awk
Usage: awk [-f programfile | ‘program’] [-Ffieldsep] [-v var=value] [files]

This suggests that awk is present as it lists the help line.

I have not installed awk/gawk. It is present in the Mac OSX installation at /usr/bin/awk

Are there some environmental or other settings I need to set so that Grass sees awk?

This also happens when opening a QGIS connection from the display manager.

Thanks

Dave

It sounds like a path problem. That is, it sounds like /usr/bin is not in your default path, or at least the one active within the GRASS environment. From the GRASS command line, type

$PATH

(followed by return) and see if /usr/bin is in the list of folders.

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


From: Dave Kent dkent@sasktel.net
Date: Mon, 06 Mar 2006 23:11:40 -0600
To: GRASSLIST@baylor.edu
Subject: [GRASSLIST:10784] awk not found on Mac osx, Repost

I posted this some time ago. Markus responded with a change which has been incorporated into CVS code.

However, this hasn’t helped things for me as I still am getting a problem with “awk required”

I am using 6.1 CVS with Lorenzo’s binaries (06 March 06 ) on a macintosh OS 10.4.

When I try to add a database column I get:

v.db.addcol map=CondieHead layer=1 ‘columns=Elev varchar(10)’
csh: /sw/bin/init.csh: No such file or directory.
: awk required, please install awk/gawk first

This suggests awk is absent. When I invoke awk from the grass command line, I get:

GRASS 6.1.cvs (SaskNad83UTM) > awk
Usage: awk [-f programfile | ‘program’] [-Ffieldsep] [-v var=value] [files]

This suggests that awk is present as it lists the help line.

I have not installed awk/gawk. It is present in the Mac OSX installation at /usr/bin/awk

Are there some environmental or other settings I need to set so that Grass sees awk?

This also happens when opening a QGIS connection from the display manager.

Thanks

Dave

Thanks Michael:

I get:

GRASS 6.1.cvs (SaskNad83UTM) > $PATH
tcsh: /usr/X11R6/bin:/usr/local/bin:/usr/local/grasslib/bin:/Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/bin:/Applicati
ons/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/scripts:/usr/bin:/bin:/usr/bin:/bin:/usr/sbin:/sbin: Command not found.

Looks like /usr/bin is present. In fact it is in twice. Could this be a problem?

What does “command not found” indicate?

Dave

On Mar 7, 2006, at 11:34 AM, Michael Barton wrote:

It sounds like a path problem. That is, it sounds like /usr/bin is not in your default path, or at least the one active within the GRASS environment. From the GRASS command line, type

$PATH

(followed by return) and see if /usr/bin is in the list of folders.

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


From: Dave Kent <dkent@sasktel.net>
Date: Mon, 06 Mar 2006 23:11:40 -0600
To: <GRASSLIST@baylor.edu>
Subject: [GRASSLIST:10784] awk not found on Mac osx, Repost

I posted this some time ago. Markus responded with a change which has been incorporated into CVS code.

However, this hasn’t helped things for me as I still am getting a problem with “awk required”

I am using 6.1 CVS with Lorenzo’s binaries (06 March 06 ) on a macintosh OS 10.4.

When I try to add a database column I get:

v.db.addcol map=CondieHead layer=1 ‘columns=Elev varchar(10)’
csh: /sw/bin/init.csh: No such file or directory.
: awk required, please install awk/gawk first

This suggests awk is absent. When I invoke awk from the grass command line, I get:

GRASS 6.1.cvs (SaskNad83UTM) > awk
Usage: awk [-f programfile | ‘program’] [-Ffieldsep] [-v var=value] [files]

This suggests that awk is present as it lists the help line.

I have not installed awk/gawk. It is present in the Mac OSX installation at /usr/bin/awk

Are there some environmental or other settings I need to set so that Grass sees awk?

This also happens when opening a QGIS connection from the display manager.

Thanks

Dave

I just noticed a potential source of the problem:

On Mar 7, 2006, at 5:43 PM, Dave Kent wrote:

When I try to add a database column I get:

v.db.addcol map=CondieHead layer=1 'columns=Elev varchar(10)'
csh: /sw/bin/init.csh: No such file or directory.

^^^^^^^^^^^^^^^^^^^^^^^^

/sw/* = Fink. Even tho it's not in your PATH in GRASS, something is looking for some software from Fink. From v.db.addcol, the test for awk is:

which awk

maybe it is 'which' that is failing to even run, not failing to find awk. Try 'which awk' from a new Terminal window.

Also, what is the PATH outside of GRASS?

: awk required, please install awk/gawk first

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

"History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy

Thanks

From the terminal:

[DDKG5:~] davekent% awk
Usage: awk [-f programfile | ‘program’] [-Ffieldsep] [-v var=value] [files]

From the Grass Command Line

GRASS 6.1.cvs (SaskNad83UTM) > awk
Usage: awk [-f programfile | ‘program’] [-Ffieldsep] [-v var=value] [files]

It seems to invoke awk in both cases.

From William’s note I tried “which awk”

GRASS 6.1.cvs (SaskNad83UTM) > which awk
/usr/bin/awk

This is the one present in the OSX system files.

With respect to fink, the only file on my system (Spotlight search for FINK) is FinkCommander.pl. I haven’t used it.

So, on a whim I opened the v.db.addcol script and commented out the portion of the script which tests to see if AWK is present.

v.db.addcol appears to work.

Emboldened by my apparent success, I did the same with d.qgis which is a second instance where I got the Awk not present error message. This works as well.

It seems that the problem is not whether AWK is present, but with the test to see if AWK is present.

Any thoughts on the cause of this.

I’m hoping that the problem isn’t too deep as commenting out code pretty much taps out my programming skills.

Thanks

Dave

On Mar 7, 2006, at 5:43 PM, Dave Kent wrote:

Thanks Michael:

I get:

GRASS 6.1.cvs (SaskNad83UTM) > $PATH
tcsh: /usr/X11R6/bin:/usr/local/bin:/usr/local/grasslib/bin:/Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/bin:/Applicati
ons/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/scripts:/usr/bin:/bin:/usr/bin:/bin:/usr/sbin:/sbin: Command not found.

Looks like /usr/bin is present. In fact it is in twice. Could this be a problem?

What does “command not found” indicate?

Dave

On Mar 7, 2006, at 11:34 AM, Michael Barton wrote:

It sounds like a path problem. That is, it sounds like /usr/bin is not in your default path, or at least the one active within the GRASS environment. From the GRASS command line, type

$PATH

(followed by return) and see if /usr/bin is in the list of folders.

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


From: Dave Kent <dkent@sasktel.net>
Date: Mon, 06 Mar 2006 23:11:40 -0600
To: <GRASSLIST@baylor.edu>
Subject: [GRASSLIST:10784] awk not found on Mac osx, Repost

I posted this some time ago. Markus responded with a change which has been incorporated into CVS code.

However, this hasn’t helped things for me as I still am getting a problem with “awk required”

I am using 6.1 CVS with Lorenzo’s binaries (06 March 06 ) on a macintosh OS 10.4.

When I try to add a database column I get:

v.db.addcol map=CondieHead layer=1 ‘columns=Elev varchar(10)’
csh: /sw/bin/init.csh: No such file or directory.
: awk required, please install awk/gawk first

This suggests awk is absent. When I invoke awk from the grass command line, I get:

GRASS 6.1.cvs (SaskNad83UTM) > awk
Usage: awk [-f programfile | ‘program’] [-Ffieldsep] [-v var=value] [files]

This suggests that awk is present as it lists the help line.

I have not installed awk/gawk. It is present in the Mac OSX installation at /usr/bin/awk

Are there some environmental or other settings I need to set so that Grass sees awk?

This also happens when opening a QGIS connection from the display manager.

Thanks

Dave

Dave:

I posted this some time ago. Markus responded with a change which has
been incorporated into CVS code.

However, this hasn't helped things for me as I still am getting a
problem with "awk required"
I am using 6.1 CVS with Lorenzo's binaries (06 March 06 ) on a
macintosh OS 10.4.
When I try to add a database column I get:

v.db.addcol map=CondieHead layer=1 'columns=Elev varchar(10)'
csh: /sw/bin/init.csh: No such file or directory.
: awk required, please install awk/gawk first

This suggests awk is absent. When I invoke awk from the grass command
line, I get:

GRASS 6.1.cvs (SaskNad83UTM) > awk
Usage: awk [-f programfile | 'program'] [-Ffieldsep] [-v var=value]
[files]

This suggests that awk is present as it lists the help line.

I have not installed awk/gawk. It is present in the Mac OSX
installation at /usr/bin/awk
Are there some environmental or other settings I need to set so that
Grass sees awk?
This also happens when opening a QGIS connection from the display
manager.

Michael:

It sounds like a path problem. That is, it sounds like /usr/bin is not
in your default path, or at least the one active within the GRASS
environment.
>>From the GRASS command line, type

$PATH
(followed by return) and see if /usr/bin is in the list of folders.

better:
GRASS> echo $PATH

just "$PATH" will try to run it as a program.

I think Michael is correct, awk is fine,

v.db.addcol map=CondieHead layer=1 'columns=Elev varchar(10)'
csh: /sw/bin/init.csh: No such file or directory.

I think this is the real error, not the missing awk.
note shell is csh not bash command interpreter, denoting the machine was
upgraded from MacOS <= 10.2.

/sw/ denotes a Fink install. Has it been removed but is still in the
executable search PATH?? check ~/.cshrc file for fink adding itself to
the PATH.

: awk required, please install awk/gawk first

Bug: that should read "v.db.addcol: awk required, please ..."
I've fixed this in CVS, repeated in many other scripts.

You can try

GRASS> which awk

to test if GRASS can find awk.

also try searching the archives, we've seen this before IIRC..

Hamish