<HTML>
<HEAD>
<TITLE>Re: [GRASSLIST:10798] Re: awk not found on Mac osx, Repost</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN DEFANGED_STYLE='font-size:12.0px'>Dave,<BR>
<BR>
I didn’t write either one of these scripts, but I’m sending this to the GRASS Developer list so that those who did might be able to troubleshoot.<BR>
<BR>
In your case, the edits you did should cause no problems.<BR>
<BR>
It LOOKS like everything is fine with your system. You might try the time tested formula of simply downloading Lorenzo’s binaries again (there is a new set yesterday that you will need if you want to use the new version of the GIS Manager with transparency I am testing and about to release). The new binaries from yesterday also have a new grass libraries file to install. <BR>
<BR>
Michael<BR>
__________________________________________<BR>
Michael Barton, Professor of Anthropology<BR>
School of Human Evolution and Social Change<BR>
Arizona State University<BR>
Tempe, AZ 85287-2402<BR>
<BR>
phone: 480-965-6213<BR>
fax: 480-965-7671<BR>
www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a> <BR>
<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>Dave Kent <dkent@sasktel.net><BR>
<B>Date: </B>Tue, 07 Mar 2006 18:23:51 -0600<BR>
<B>To: </B>Michael Barton <michael.barton@asu.edu><BR>
<B>Cc: </B>Multiple recipients of list <GRASSLIST@baylor.edu><BR>
<B>Subject: </B>Re: [GRASSLIST:10798] Re: awk not found on Mac osx, Repost<BR>
<BR>
Thanks<BR>
<BR>
>From the terminal:<BR>
<BR>
[</SPAN></FONT><SPAN DEFANGED_STYLE='font-size:12.0px'><FONT FACE="Courier, Courier New">DDKG5:~] davekent% awk<BR>
Usage: awk [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]<BR>
<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"><BR>
>From the Grass Command Line<BR>
<BR>
</FONT><FONT FACE="Courier, Courier New">GRASS 6.1.cvs (SaskNad83UTM) > awk<BR>
Usage: awk [-f programfile | 'program'] [-Ffieldsep] [-v var=valu</FONT><FONT FACE="Verdana, Helvetica, Arial">e] </FONT><FONT FACE="Courier, Courier New">[files]<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"><BR>
It seems to invoke awk in both cases.<BR>
<BR>
<BR>
>From William's note I tried "which awk"<BR>
<BR>
</FONT><FONT FACE="Courier, Courier New">GRASS 6.1.cvs (SaskNad83UTM) > which awk<BR>
/usr/bin/awk<BR>
<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial">This is the one present in the OSX system files.<BR>
<BR>
With respect to fink, the only file on my system (Spotlight search for FINK) is FinkCommander.pl. I haven't used it.<BR>
<BR>
<BR>
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.<BR>
<BR>
v.db.addcol appears to work.<BR>
<BR>
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.<BR>
<BR>
It seems that the problem is not whether AWK is present, but with the test to see if AWK is present.<BR>
<BR>
Any thoughts on the cause of this. <BR>
<BR>
I'm hoping that the problem isn't too deep as commenting out code pretty much taps out my programming skills.<BR>
<BR>
Thanks<BR>
<BR>
Dave<BR>
<BR>
<BR>
<BR>
On Mar 7, 2006, at 5:43 PM, Dave Kent wrote:<BR>
<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN DEFANGED_STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial">Thanks Michael:<BR>
<BR>
I get:<BR>
<BR>
</FONT><FONT FACE="Courier, Courier New">GRASS 6.1.cvs (SaskNad83UTM) > $PATH<BR>
tcsh: /usr/X11R6/bin:/usr/local/bin:/usr/local/grasslib/bin:/Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/bin:/Applicati<BR>
ons/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/scripts:/usr/bin:/bin:<FONT COLOR="#3712B2">/</FONT><FONT COLOR="#0C08B2">usr/bin</FONT>:/bin:/usr/sbin:/sbin: Command not found.<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"><BR>
<BR>
Looks like /usr/bin is present. In fact it is in twice. Could this be a problem?<BR>
<BR>
What does "command not found" indicate?<BR>
<BR>
Dave<BR>
<BR>
<BR>
On Mar 7, 2006, at 11:34 AM, Michael Barton wrote:<BR>
<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN DEFANGED_STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"> 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 <BR>
<BR>
$PATH<BR>
<BR>
(followed by return) and see if /usr/bin is in the list of folders.<BR>
<BR>
Michael<BR>
______________________________<BR>
Michael Barton, Professor of Anthropology<BR>
School of Human Evolution and Social Change<BR>
Arizona State University<BR>
Tempe, AZ 85287-2402<BR>
USA<BR>
<BR>
voice: 480-965-6262; fax: 480-965-7671<BR>
www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a><BR>
<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>Dave Kent <dkent@sasktel.net><BR>
<B>Date: </B>Mon, 06 Mar 2006 23:11:40 -0600<BR>
<B>To: </B><GRASSLIST@baylor.edu><BR>
<B>Subject: </B>[GRASSLIST:10784] awk not found on Mac osx, Repost<BR>
<BR>
I posted this some time ago. Markus responded with a change which has been incorporated into CVS code.<BR>
<BR>
However, this hasn't helped things for me as I still am getting a problem with "awk required"<BR>
<BR>
I am using 6.1 CVS with Lorenzo's binaries (06 March 06 ) on a macintosh OS 10.4. <BR>
<BR>
When I try to add a database column I get:<BR>
<BR>
</FONT><FONT FACE="Courier, Courier New">v.db.addcol map=CondieHead layer=1 'columns=Elev varchar(10)'<BR>
csh: /sw/bin/init.csh: No such file or directory.<BR>
: awk required, please install awk/gawk first<BR>
<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
This suggests awk is absent. When I invoke awk from the grass command line, I get:<BR>
<BR>
</FONT><FONT FACE="Courier, Courier New">GRASS 6.1.cvs (SaskNad83UTM) > awk<BR>
Usage: awk [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]<BR>
<BR>
</FONT><FONT FACE="Verdana, Helvetica, Arial"> <BR>
This suggests that awk is present as it lists the help line.<BR>
<BR>
I have not installed awk/gawk. It is present in the Mac OSX installation at /usr/bin/awk<BR>
<BR>
Are there some environmental or other settings I need to set so that Grass sees awk?<BR>
<BR>
This also happens when opening a QGIS connection from the display manager.<BR>
<BR>
Thanks<BR>
<BR>
Dave<BR>
<BR>
<BR>
<BR>
</FONT></SPAN></BLOCKQUOTE><SPAN DEFANGED_STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"><BR>
</FONT></SPAN></BLOCKQUOTE><SPAN DEFANGED_STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"><BR>
<BR>
</FONT></SPAN>
</BODY>
</HTML>