分享

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

 digitaldreamer 2007-04-28

Bash: Where to get it

Bash can be gotten in two main places. The latest copy (including beta versions) can be gotten from slc2.ins.cwru.edu

The latest stable version can be retrieved from the main source of gnu software at prep.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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多