[GRASS5] GRASS_PAGER

Paul Kelly paul-grass at stjohnspoint.co.uk
Fri Mar 11 17:12:02 EST 2005


On Fri, 11 Mar 2005, Hamish wrote:

>>     180 if [ ! "$GRASS_PAGER" ] ; then
>>     181     if [ -x /bin/more ] ; then
>>     182         GRASS_PAGER=more
>>     183     else
>>     184         GRASS_PAGER=less
>>     185     fi
>>     186     export GRASS_PAGER
>
>
> On Mac OSX, "more" is in /usr/bin/.  init.sh updated in CVS to look
> there too before reverting to "less". Where is it on cygwin?

I don't think it is installed with a default Cygwin installation; perhaps 
that is where the original problem with hard-coded more came to light.

Anyway, from the GRASS SUBMITTING file:

21. If you write a shell script and search for a command in $PATH, do NOT
     use the "which" command or the "type -p" command. Both commands are not
     supported on all platforms, thus causing problems for some people. As an
     alternative, please use code similar to the following shell script snippet
     which will perform the same function. In this case, the path of the grass5
     command is saved if grass5 is found in $PATH. This won't recognize aliased
     command name.

 	# Search for grass5 command in user's path
 	for i in `echo $PATH | sed 's/^:/.:/
     	    	    		    s/::/:.:/g
 				    s/:$/:./
 				    s/:/ /g'`
 	do
 	    if [ -f $i/grass5 ] ; then

 		# Save the path of the grass5 command
 		GRASS_PATH=$i/grass5
 		# Use the first one in user's path
 		break
 	    fi
 	done

So that's probably how the test should be done.


Paul





More information about the grass-dev mailing list