home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / modes / J-Shell-1.1 / dot-bashrc < prev    next >
Encoding:
Text File  |  1993-03-06  |  1.5 KB  |  63 lines

  1. # $Id: dot-bashrc,v 1.0 1993/03/07 04:42:04 jct Exp $
  2.  
  3. ## This file contains a sample script showing how to set up ksh to
  4. ## work properly with j-shell.  Before examining this script, please
  5. ## read the comments in the file dot-tcsh; the comments in that script
  6. ## describe steps common to the scripts for all shells.
  7.  
  8. # Comments delimited by a single # are specific to bash.
  9.  
  10. if [ "$TERM" = "emacs" ]
  11. then
  12.     stty nl -echo        # Keeps ^M from echoing
  13.  
  14.     ## Step A.
  15.     emacscd=`builtin echo -e "\033EmAcScd"`
  16.     emacshost=`builtin echo -e "\033EmAcShost"`
  17.  
  18.     ## Step B.
  19.     alias cwdcmd="echo $emacscd \$PWD"
  20.     alias hostcmd="echo $emacshost `hostname`"
  21.     alias reorient="hostcmd ; cwdcmd"
  22. fi
  23.  
  24. # For some reason, in bash, the above aliases don't take unless
  25. # they're in a different if-construct than the following aliases.
  26. # Perhaps some bash expert can explain this to me.
  27.  
  28. if [ "$TERM" = "emacs" ]
  29. then
  30.     # Step C.
  31.     cd() { builtin cd $* ; cwdcmd }
  32.     pushd() { builtin pushd $* ; cwdcmd }
  33.     popd() { builtin popd $* ; cwdcmd }
  34.  
  35.     # Step D.
  36.     fake_rlogin() { rlogin $*; reorient ; }
  37.     alias rlogin='fake_rlogin '
  38.  
  39.     fake_sh() { sh $*; reorient ; }
  40.     alias sh=fake_sh
  41.  
  42.     fake_ksh() { ksh $*; reorient ; }
  43.     alias ksh=fake_ksh
  44.  
  45.     fake_csh() { csh $*; reorient ; }
  46.     alias csh=fake_csh
  47.  
  48.     fake_tcsh() { tcsh $*; reorient ; }
  49.     alias tcsh=fake_tcsh
  50.  
  51.     fake_zsh() { zsh $*; reorient ; }
  52.     alias zsh=fake_zsh
  53.  
  54.     fake_bash() { bash $*; reorient ; }
  55.     alias bash=fake_bash
  56.  
  57.     fake_tcl() { tcl $*; reorient ; }
  58.     alias tcl=fake_tcl
  59.  
  60.     # Step E.
  61.     reorient
  62. fi
  63.