[GRASS5] which, less and SUBMITTING

Reinhard Brunzema r.brunzema at web.de
Wed Apr 11 14:13:03 EDT 2001


Andreas Lange schrieb:
> 
> Hi Reinhard,
> 
> one simple question: Why don't you put a "export PAGER=less" in your
> .profile or .bashrc (or other startup file depending on your favourite
> shell)?

This would fix the problem on my machine, but not anywhere else in the
world.
The real problem is, currently GRASS changes the default behavior of
parts of the system. Linux users expect man running the 'less-way'. When
they try to read a man page in GRASS they will get confused, because
they can't use the arrow keys.
They look for help, GRASS makes them confused - Not a friendly behavior.

When they want the old and common behavior of the man pages back, they
have to do a lot of work. I don't mean adding PAGER=less in a
configuration file - I mean finding out, what they have to do. You have
to be a unix/linux expert or at least a advanced user to know that PAGER
is related to man.

In general I think, a program should keep as much work away from the
user as possible.

When you look in the Changelog, you see, that in most cases PAGER is
used to _replace_ more. On linux-systems it does the opposite. IMHO
that's a bug.

> This would allow individual customization of the pager, which is in my
> eyes the purpose of the GRASS initialization setup. The code in init.sh
> is IMHO only providing a fallback in case no PAGER variable is set.

The new code wouldn't change that behavior. It's just a better fallback.

> 
> The problem with the G_which shell script is that the scripts depending
> on which (some of them are written by me, i admit), must be changed.

I was told on this list, that it 'which' is not portable enough. So I
looked for a better portable replacement, that can easely be used.

> 
> Under cygwin/windows i created a system wide script which looks like
> that:
> 
> #!/bin/sh
> SAVEIFS="$IFS"
> IFS=":"
> FOUND=""
> for FILE in $PATH ; do
>    if [ -x "$FILE/$1" ] ; then
>       FOUND="$FILE/$1"
>    fi
> done
> IFS="$SAVEIFS"
> echo -n $FOUND
> 

Great! This looks like an easier solution and it is independent of
'sed'. You should add a return value dependend on
successfull/unsuccessfull search, because some of the 'which scripts'
work with that value. After this it should go in the GRASS
distributions, so everyone can work with it (IMHO).

> ----------------------------------------
> If you want to unsubscribe from GRASS Development Team mailing list write to:
> minordomo at geog.uni-hannover.de with
> subject 'unsubscribe grass5'


---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list