tcsh

Lars Schylberg larss at lmv.lm.se
Thu Jan 30 10:13:04 EST 1992


To all of you that are sitting with grass development everyday
I would like share a little goodie that I found last week.  It is 
the the tcsh that is a public domain shell that is an addition to 
csh.  It contains command line stack, editing, completion and lots
of other nice things.  This has only been availble for those have
had source code licence for unix before, but is now rewritten so that
you that don't need that.   It compiled nicely both on
our Apollo and Sun sparc machines.  I think you can find tcsh on most
bigger anonymous ftp machines.

This tcsh makes development of awk scritps much easier since you can 
edit on the command line.

The only changes you have to make in Grass is to edit the 
$GISBASE/etc/GIS.sh file a little like follows.  

I have also modified the scripts to bring in personal aliases and set
up rm -r for everybody which I think is necesary.

Lars Schylberg
National Land Survey of Sweden           Dept. of Photogrammetry
R&D Departmant                           Royal Inst. of Technology
S-80112 Gavle, Sweden                    10044 Stockholm, Sweden

larss at lmv.lm.se                          larss at fmi.kth.se

###################################################
Parts of GIS.sh
###################################################

--------------------------------------------------
if test "$SHELL"
then
    if [ "$SHELL" = "/usr/local/bin/tcsh" ]
    then
	shell=tcsh
	shellname="TC Shell"
    fi
fi
--------------------------------------------------
things in between
--------------------------------------------------
This version running thru the $shellname ($shell)
Help is available with the command: g.help
When ready to quit enter:           exit
EOF

if [ $shell = csh ]
then
    HOME=$LOCATION
    export HOME
    cshrc=$HOME/.cshrc
    rm -f $cshrc
    echo "set home = $home" > $cshrc
    echo "set history=30 noclobber ignoreeof" >> $cshrc

#
# Added by Lars Schylberg, 910730 to bring all aliases into the GRASS shell
#
    if [ -r $home/.aliases ]
    then
	cat $home/.aliases >> $cshrc
    fi

    echo "alias rm 'rm -i'" >> $cshrc

    echo "set prompt='\\" >> $cshrc
    echo "Mapset <$MAPSET> in Location <$LOCATION_NAME>\\" >> $cshrc
    echo "GRASS 4.0 > '" >> $cshrc

    if [ -r $home/.grass.cshrc ]
    then
	cat $home/.grass.cshrc >> $cshrc
    fi

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

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

    $ETC/run csh

    HOME=$home
    export HOME

elif [ $shell = tcsh ]
then
    HOME=$LOCATION
    export HOME
    cshrc=$HOME/.cshrc
    rm -f $cshrc
    echo "set home = $home" > $cshrc
    echo "set history=30 noclobber ignoreeof" >> $cshrc

#
# Added by Lars Schylberg, 910730 to bring all aliases into the GRASS shell
#
    if [ -r $home/.aliases ]
    then
	cat $home/.aliases >> $cshrc
    fi

    echo "alias rm 'rm -i'" >> $cshrc

    echo "set prompt='\\" >> $cshrc
    echo "Mapset <$MAPSET> in Location <$LOCATION_NAME>\\" >> $cshrc
    echo "GRASS 4.0 > '" >> $cshrc

    if [ -r $home/.grass.cshrc ]
    then
	cat $home/.grass.cshrc >> $cshrc
    fi

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

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

    $ETC/run tcsh

    HOME=$home
    export HOME

else

PS1="
Mapset <$MAPSET> in Location <$LOCATION_NAME>
GRASS-GRID > "

    export PS1

    $ETC/run sh
fi
-----------------------------------------------------------------------
















More information about the grass-dev mailing list