[GRASS5] zsh support in GRASS

Alexandre Sorokine sorokin at vtt.co.jp
Sat Jun 15 22:56:51 EDT 2002


Hi!

Here is a patch for $GISBASE/etc/Init.sh that provides the same style of 
support for Z shell (http://zsh.sunsite.dk/) as a GRASS shell as bash 
and tcsh have:

--- Init.sh.orig	Sat Jun  8 20:28:39 2002
+++ Init.sh	Sat Jun 15 22:56:06 2002
@@ -378,6 +378,7 @@
          tcsh) shellname="TC Shell" ;;
          bash) shellname="Bash Shell" ;;
          sh)   shellname="Bourne Shell";;
+        zsh)  shellname="Z Shell";;
          *)    shellname=shell;;
      esac
  fi
@@ -505,6 +506,29 @@

      echo "export PATH=\"$PATH\"" >> $bashrc
      echo "export HOME=\"$USERHOME\"" >> $bashrc # restore user home path
+
+    $ETC/run $SHELL
+    HOME=$USERHOME
+    export HOME
+    ;;
+
+zsh)
+    USERHOME=$HOME      # save original home
+    HOME=$LOCATION      # save .zshrc in $LOCATION
+    export HOME
+    zshrc=$HOME/.zshrc
+    rm -f $zshrc
+    echo "test -z $ZPROFILEREAD && . /etc/zprofile" > $zshrc
+    echo "umask 022" >> $zshrc
+    echo "PS1='GRASS:%2d > '" >> $zshrc
+
+    if [ -r $USERHOME/.grass.zshrc ]
+    then
+        cat $USERHOME/.grass.zshrc >> $zshrc
+    fi
+
+    echo "export PATH=\"$PATH\"" >> $zshrc
+    echo "export HOME=\"$USERHOME\"" >> $zshrc # restore user home path

      $ETC/run $SHELL
      HOME=$USERHOME



-- 
Alexandre Sorokine
Department of Geography
University at Buffalo
mailto:sorokine at buffalo.edu




More information about the grass-dev mailing list