Bash: Where and How to make it your default s...

来源:百度文库 编辑:神马文学网 时间:2024/04/25 13:15:40
Bash: Where to get it
Bash can be gotten in two main places. The latest copy (including beta versions) can be gotten fromslc2.ins.cwru.edu
The latest stable version can be retrieved from the main source of gnu software atprep.ai.mit.edu via ftp. There are also mirrors all over the world.
Bash: How to make it your default shell
If you have root access you can change /etc/passwd to /bin/bash or wherever bash is installed If not you can sometimes use either `chsh‘ or `ypchsh‘ to change your shell. If you can‘t do either of the above then assuming that your default shell is `/bin/csh‘ then you can do the following to make bash your interactive shell. (The c-shell be used as the default non-interactive shell.) place the bash executable in ~/bin/bash ln -s $HOME/bin/bash ~/-bash use the following as your .cshrc file: Note: You should modify the set path statement and the setenv SHELL statement to reflect where things are on your machine. # override default login C shell to use bash
if (!($?PATH_SET)) then
  setenv PATH_SET 1
  # modify path and MANPATH for your system.  It is your path for
  # non-interactive shells and things like rcp.
  set path = (/bin /usr/bin /usr/ucb /usr/lbin /usr/bin/X11 $HOME/bin ./)
  setenv MANPATH /usr/local/man:/usr/man
endif
if ($?prompt) then
  if (! $?SH_EXECD) then
    setenv SHELL ~/bin/bash           # Set shell to wherever bash is located.
    setenv SH_EXECD yes
    switch ($?TERM)
      case 1:
        cd
        if ( ! -x -bash ) then
          echo "Can‘t execute bash"
          exit
        endif
        exec -bash
        breaksw
      default:
        if ( ! -x $SHELL ) then
          echo "Can‘t execute bash"
          exit
        endif
        exec $SHELL
        breaksw
    endsw
    echo **** Warning: exec bash failed ****
  endif
endif
     If for some this script doesn‘t let you login you can always use ftp to get into your account and delete .cshrc to start over again.
Bash: Make sure its in /etc/shells
The complete path to bash must be in /etc/shells (on most unix systems) or you won‘t be able to ftp into your account.
up