[GRASS5] Questions regarding GIS.sh

Hello all

As you may know, I am creating a new interface for the startup routines of
GRASS in Tcl/Tk. At the same time I would like to clean up some of the existing
code. Since I am not that familiar with sh script programming, my initial
investigation has led to some questions that I would like to pose to the list.
I would appreciate any answers to the following questions. Note that the file
etc/GIS.sh is created from three files in src/general/gis, namely gis.head,
gis.shell, and gis.tail

1. In gis.head the user's home directory is determined by
  home=`cd;pwd`
   Is it safe to assume that this information can be obtained from the $HOME
   environment variable? It seems to me that the $HOME variable is guaranteed
to
   exist on all platforms. Is there any reason not to use it?

2. In gis.head the path is set to the GRASS bin directory and also the garden
   bin directory. Why do we have a garden bin directory? Why are these binaries
   kept separate from the other binaries? By default, nothing is compiled into
   this directory, so why is it there? BTW, why is it named "garden" in the
   first place? It is not a very intuitive name to me.

3. In gis.head the following line is used to unset the MONITOR variable
  # unset the MONITOR variable to force user to select one if they are
  # going to do graphics.

  g.gisenv MONITOR=
   Why do we need to unset this variable? Is it simply to ensure that the user
   does not have a variable of the same name in their own environment? If so,
   then why don't we rename the variable to GRASS_MONITOR to ensure this is not
   the case?

4. In gis.head the following lines appear
  if [ -x $home/.grassrc5.VERSION_NUMBER ]
  then
    $home/.grassrc5.VERSION_NUMBER
  elif [ -x $GISBASE/grassrc5 ]
  then
    $GISBASE/grassrc5
  fi
   Markus has indicated that these files are there for historical reasons and
   should be able to be deleted. Is this true? Anyone know of a reason to keep
   them?

5. In gis.shell there is a trap statement to trap SIGINT and SIGQUIT, but these
   are ignored. Do we still need to ignore these signals? What was the original
   reason for ignoring them in the first place?

6. In gis.shell, for a csh or tcsh, the following line is set for the grass
   version of the .cshrc file
  echo 'set BOGUS=``;unset BOGUS' >> $cshrc
   What is the use of this? Why is this here? This does not appear for other
   shells. Also there are these lines that appear only for csh and tcsh users
  if [ -r $home/.cshrc ]
      then
    grep '^ *set *mail *= *' $home/.cshrc >> $cshrc
      fi

      if [ -r $home/.tcshrc ]
      then
    grep '^ *set *mail *= *' $home/.tcshrc >> $cshrc
      fi

      if [ -r $home/.login ]
      then
    grep '^ *set *mail *= *' $home/.login >> $cshrc
      fi
   What are these for? Do we still need them anymore? Wouldn't it just be
easier
   to just put the users home settings at the first of the file and then put
the
   GRASS specific settings at the end of the file? That way, the user maintains
   his settings (aliases, etc) and any GRASS settings can override the users if
   necessary.

7. In gis.shell, the bash section has the following 2 lines
  echo "umask 022" >> $bashrc
      echo "PS1='GRASS:\w > '" >> $bashrc
   Why do bash users have a umask, but no other shell users do? How does
   GRASS:\w actually set the prompt?

8. In gis.shell, all other shells set the prompt using
  PS1="
  Mapset <$MAPSET> in Location <$LOCATION_NAME>
  GRASS-GRID > "
   How does GRASS-GRID set the version number of GRASS?

9. It appears that src/libes/gis/env.c reads and writes to the .grassrc file
for
   most of its environment variables. I do not agree with this technique. For
me
   any .*rc file simply saves the environment that the program was in the last
   time the user used the program. This enables the program to be set into the
   last environment the next time the program is started. Therefore, the only
   time the .*rc file is accessed is to read in the previous environment at
   program startup, and then write the current environment at program shutdown.
   Thus, I propose to change env.c so that the only time the .grassrc file is
   accessed is during startup and shutdown. All other requests for environment
   variables will access the actual environment, not the .grassrc file. Does
   anyone know of any reason for not making this change?

Finally, a question totally unrelated to my project but it concerns something I
came across in my investigations. There are a couple of strange directory names
in the tree. etc/paint/driver.sh and src/imagery/i.tapes.mss.h These names
appear to be files but they are actually directories. Is there any reason for
this? It does seem strange to me since one looks like a shell script and the
other looks like a header file.

Anyway, if anyone can help answer these questions, it would be greatly
appreciated. Thank you for your time.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand

People who think they know everything are very irritating to those
of us who do. ---Anonymous

Jazz and Trek Rule!!!

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

Justin Hickey wrote:
[...]

1. In gis.head the user's home directory is determined by
        home=`cd;pwd`
   Is it safe to assume that this information can be obtained from the $HOME
   environment variable? It seems to me that the $HOME variable is guaranteed
   to exist on all platforms. Is there any reason not to use it?

[etc...]

Your idea for a tcl/tk startup routine is very good, but
don't forget that this interface may be also used
with Windows, once the port of monitor will be completed. So
you should look at Unix and Windows when programming your tcl/tk
interface.

Just my 2 cents

--
Michel Wurtz ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45 Fax: +33 03.88.37.04.97

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

Dear developers,

GRASS 5 lacks a bug report system. My small bug report
page is not sufficient to manage such a big project.
An interesting system could be "Jitterbug". An example
you can see here:

The Comprehensive R Archive Network
http://r-bugs.biostat.ku.dk/R

The Jitterbug is available here:
http://samba.anu.edu.au/jitterbug/

Now my question:
Who is willing to take care of this and install a GRASS
bug report system?

Thanks for your time

Markus Neteler

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

Hello Michel

On Jul 3, 5:20pm, Michel Wurtz - ENGEES/CEREG wrote:

Subject: Re: [GRASS5] Questions regarding GIS.sh

> 1. In gis.head the user's home directory is determined by
> home=`cd;pwd`
> Is it safe to assume that this information can be obtained from the

$HOME

> environment variable? It seems to me that the $HOME variable is
> guaranteed to exist on all platforms. Is there any reason not to use it?

Your idea for a tcl/tk startup routine is very good, but
don't forget that this interface may be also used
with Windows, once the port of monitor will be completed. So
you should look at Unix and Windows when programming your tcl/tk
interface.

I agree that considering porting issues for Windows is important.
Unfortunately, I have no idea how to port Unix specific shell scripts (like
GIS.sh) to Windows. Also, Markus has asked me to finish this interface soon,
therefore, I do not have time to learn how to port shell scripts to Windows. I
would greatly appreciate it if you could provide any assistance with the
porting issues for Windows.

Thank you for your comments.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand

People who think they know everything are very irritating to those
of us who do. ---Anonymous

Jazz and Trek Rule!!!

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

For what it's worth, the Windows port relies on the Cygwin emulation
layer, and bash is the standard shell. You should (in theory, although
don't hold your breath on this...) be able to run the shell script under
Windows quite happily.

There are some missing abilities, however, and every once in a while, we
encounter them.

Angus Carr.

Justin Hickey wrote:

Hello Michel

On Jul 3, 5:20pm, Michel Wurtz - ENGEES/CEREG wrote:
> Subject: Re: [GRASS5] Questions regarding GIS.sh
>
> > 1. In gis.head the user's home directory is determined by
> > home=`cd;pwd`
> > Is it safe to assume that this information can be obtained from the
$HOME
> > environment variable? It seems to me that the $HOME variable is
> > guaranteed to exist on all platforms. Is there any reason not to use it?
>
> Your idea for a tcl/tk startup routine is very good, but
> don't forget that this interface may be also used
> with Windows, once the port of monitor will be completed. So
> you should look at Unix and Windows when programming your tcl/tk
> interface.

I agree that considering porting issues for Windows is important.
Unfortunately, I have no idea how to port Unix specific shell scripts (like
GIS.sh) to Windows. Also, Markus has asked me to finish this interface soon,
therefore, I do not have time to learn how to port shell scripts to Windows. I
would greatly appreciate it if you could provide any assistance with the
porting issues for Windows.

Thank you for your comments.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand

People who think they know everything are very irritating to those
of us who do. ---Anonymous

Jazz and Trek Rule!!!

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

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

Hello Angus

On Jul 5, 10:50am, A Carr wrote:

For what it's worth, the Windows port relies on the Cygwin emulation
layer, and bash is the standard shell. You should (in theory, although
don't hold your breath on this...) be able to run the shell script under
Windows quite happily.

There are some missing abilities, however, and every once in a while, we
encounter them.

Thank you for this information. In that case I guess I'll make my changes and
see if any problems arise in porting it to Windows. These problems - if any -
can be dealt with at that time, and from what you say, they should be minor (I
hope!).

Thanks again.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand

People who think they know everything are very irritating to those
of us who do. ---Anonymous

Jazz and Trek Rule!!!

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