[GRASS-user] GRASS-QGIS connection

Hello,

I'm running Lorenzo's binaries (6.2.1) on OS X. I've recently switched my default shell program from tcsh to bash. When I try to launch QGIS from within GRASS, I receive the following:

csh: /Applications/GrassGIS/Grass6.app/Contents/Resources/grass-6.2.1/bin:/Applications/GrassGIS/Grass6.app/Contents/Resources/grass-6.2.1/scripts:/Applications/GrassGIS/Grass6.app/Contents/Resources/grass-6.2.1/etc/gm/script:/usr/local/grasslib/bin:/usr/bin:/usr/sbin:/bin:/sbin:/sw/bin:/sw/sbin:/Users/[your_user_name]/bin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin: No match.
: awk required, please install awk or gawk first

I assume this is because bash isn't finding the proper path information, which was set when I was running tcsh. What is the best way to set this information for bash?

Thanks in advance,

Dave Kindem
Grand Haven, MI, USA

David Kindem wrote:

I'm running Lorenzo's binaries (6.2.1) on OS X. I've recently
switched my default shell program from tcsh to bash. When I try to
launch QGIS from within GRASS, I receive the following:

csh: /Applications/GrassGIS/Grass6.app/Contents/Resources/grass-6.2.1/
bin:/Applications/GrassGIS/Grass6.app/Contents/Resources/grass-6.2.1/
scripts:/Applications/GrassGIS/Grass6.app/Contents/Resources/
grass-6.2.1/etc/gm/script:/usr/local/grasslib/bin:/usr/bin:/usr/sbin:/
bin:/sbin:/sw/bin:/sw/sbin:/Users/[your_user_name]/bin:/usr/local/
bin:/usr/local/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin: No
match.
: awk required, please install awk or gawk first

I assume this is because bash isn't finding the proper path
information, which was set when I was running tcsh. What is the best
way to set this information for bash?

The most reliable place is ~/.bash_profile.

There are also system files (e.g. /etc/profile) which configure bash
for all users, but these tend to be heavily tailored to a specific OS,
so it's hard to provide generic advice for those.

--
Glynn Clements <glynn@gclements.plus.com>

Hi David

Hello,

I’m running Lorenzo’s binaries (6.2.1) on OS X. I’ve recently switched my default shell program from tcsh to bash. When I try to launch QGIS from within GRASS, I receive the following:

Bash shell is required.

In a new Terminal window enter:
% env
and see the result. If you see this row:
SHELL=/bin/bash

Bash shell is used and you can use GRASS OS X.

Or change your default shell inside OS X in two ways:

Solid way:
Go to into the NetInfo Manager program (Applications → Utilities → NetInfo Manager). Click on “users” then find your account. In the lower pane is “shell” and see the path. If you see “/bin/tcsh” change it to /bin/bash, then quit NetInfo Manager and restart.

Light way:
If you don’t want to change the NetInfo database entry for your account, go to Terminal application (Applications → Utilities → Terminal) then go to Terminal → Terminal Preferences and select “Execute this command” and make sure it’s the shell you want (usually is /bin/bash).

awk is used in many command inside Grass. It’s checked at the start of script.
Go to Terminal and in the new window (not inside Grass) enter:
% which awk
and see the result. In OS X the path is:
% /usr/bin/awk

If you want you can comment the rows where awk is checked …
Edit with Text editor the file “/Applications/GrassGIS/Grass6.app/Contents/Resources/grass-6.2.1/scripts/d.qgis”

and comment these rows:

Check if we have awk.

if [ ! -x “which awk” ] ; then

echo “$SCRIPT: awk required, please install awk or gawk first” 2>&1

exit 1

fi

Now restart d.qgis script (Open Qgis application under Xtns menu) and select QGIS to run or inside terminal enter:

—> GRASS OS X
GRASS 6.2.1 (location):~ > d.qgis file=/Applications/qgis-0.8.0/qgis.app &

—> GRASS X11
GRASS 6.2.1 (location):~ > d.qgis file=/Applications/qgis-0.8.0/qgis.app/Contents/MacOS/qgis &

Bye


|| Lorenzo Moretti e-mail: lorenzo.moretti@bologna.enea.it
||/|/| ENEA ACS PROTIDR Web: http://wwwamb.bologna.enea.it/
|| | via Don Fiammelli, 2

ENEA - Ente Nazionale per le Nuove Tecnologie, l'Energia e l'Ambiente
ENEA - The Italian Agency for New Technologies, Energy and the Environment
__________________________________________________________________________

Lorenzo,

Thanks to you and the others who responded.

I’ve commented out the rows where awk is checked, and I can now enter QGIS from GRASS.

Is there any problem because the software is not locating awk when it opens QGIS?

Thanks again,

Dave

Dave Kindem
Grand Haven, MI

On Jun 11, 2007, at 5:53 AM, Lorenzo Moretti wrote:

Hi David

Hello,

I’m running Lorenzo’s binaries (6.2.1) on OS X. I’ve recently switched my default shell program from tcsh to bash. When I try to launch QGIS from within GRASS, I receive the following:

Bash shell is required.

In a new Terminal window enter:
% env
and see the result. If you see this row:
SHELL=/bin/bash

Bash shell is used and you can use GRASS OS X.

Or change your default shell inside OS X in two ways:

Solid way:
Go to into the NetInfo Manager program (Applications → Utilities → NetInfo Manager). Click on “users” then find your account. In the lower pane is “shell” and see the path. If you see “/bin/tcsh” change it to /bin/bash, then quit NetInfo Manager and restart.

Light way:
If you don’t want to change the NetInfo database entry for your account, go to Terminal application (Applications → Utilities → Terminal) then go to Terminal → Terminal Preferences and select “Execute this command” and make sure it’s the shell you want (usually is /bin/bash).

awk is used in many command inside Grass. It’s checked at the start of script.
Go to Terminal and in the new window (not inside Grass) enter:
% which awk
and see the result. In OS X the path is:
% /usr/bin/awk

If you want you can comment the rows where awk is checked …
Edit with Text editor the file “/Applications/GrassGIS/Grass6.app/Contents/Resources/grass-6.2.1/scripts/d.qgis”

and comment these rows:

Check if we have awk.

if [ ! -x “which awk” ] ; then

echo “$SCRIPT: awk required, please install awk or gawk first” 2>&1

exit 1

fi

Now restart d.qgis script (Open Qgis application under Xtns menu) and select QGIS to run or inside terminal enter:

—> GRASS OS X
GRASS 6.2.1 (location):~ > d.qgis file=/Applications/qgis-0.8.0/qgis.app &

—> GRASS X11
GRASS 6.2.1 (location):~ > d.qgis file=/Applications/qgis-0.8.0/qgis.app/Contents/MacOS/qgis &

Bye


|| Lorenzo Moretti e-mail: lorenzo.moretti@bologna.enea.it
||/|/| ENEA ACS PROTIDR Web: http://wwwamb.bologna.enea.it/
|| | via Don Fiammelli, 2

ENEA - Ente Nazionale per le Nuove Tecnologie, l'Energia e l'Ambiente
ENEA - The Italian Agency for New Technologies, Energy and the Environment
__________________________________________________________________________