[GRASS5] which, less and SUBMITTING

Reinhard Brunzema r.brunzema at web.de
Wed Apr 11 10:34:33 EDT 2001


Hallo,

as you told me, 'which' is not available on some systems. So I wrote a
shell-script G_which, following the instructions in SUBMITTING, that can
be used as a replacement for 'which' in most cases.

I think, using this script will make writing, reading and understanding
scripts easier.
It can also be used to correct the scripts still using 'which' (I found
four in the current beta-release: g.man2html, r.to.pg, s.in.garmin.sh,
v.in.garmin.sh) within a few seconds.


It can also be used, to make 'less' available for the systems, where it
is available. The code in init.sh could look like this:

# Set some environment variables if they are not set
if [ ! "$PAGER" ] ; then
	G_which less > /dev/null
	if [ $? = 0 ] ; then
	PAGER=less
	else
    PAGER=more
    fi
    export PAGER
fi

I still think, that 'less' should be used. And I don't think, it is up
to the user to get it working. Most users will only notify, that less
doesn't work, but only a few of them will be able to fix it on their
own.

Comments on SUBMITTING:
If you look at the start of the document, it looks like a cvs-HOWTO. But
it contains much more than this, so maybe someone could add a hint in
the first lines, that it also contains basic programming instructions.
Also I would suggest, it should go in the binary distribution: People
writing shell-scripts they consider usefull for others don't have
necessarilly the source-tree installed.

Regards
Reinhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: G_which.gz
Type: application/x-gzip
Size: 596 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20010411/8ff8d2b2/G_which.gz


More information about the grass-dev mailing list