Board logo

标题: [求助] 登录ssh,错误提示,怎么解决? [打印本页]

作者: 喜欢眺望远处    时间: 2013-9-20 21:13     标题: 登录ssh,错误提示,怎么解决?

本帖最后由 喜欢眺望远处 于 2013-9-20 21:15 编辑





登录ssh,错误提示


: command not found
: command not found
: command not found
'bash: /etc/profile: line 11: syntax error near unexpected token `{
'bash: /etc/profile: line 11: `pathmunge(){

怎么解决?

  1. # /etc/profile

  2. # System wide environment and startup programs, for login setup
  3. # Functions and aliases go in /etc/bashrc

  4. # It's NOT a good idea to change this file unless you know what you
  5. # are doing. It's much better to create a custom.sh shell script in
  6. # /etc/profile.d/ to make custom changes to your environment, as this
  7. # will prevent the need for merging in future updates.

  8. pathmunge(){
  9.     case "{PATH}:" in
  10.         *:"$1":*)
  11.             ;;
  12.         *)
  13.             if [ "$2" = "after" ] ; then
  14.                 PATH=$PATH1
  15.             else
  16.                 PATH=$1PATH
  17.             fi
  18.     esac
  19. }


  20. if [ -x /usr/bin/id ]; then
  21.     if [ -z "$EUID" ]; then
  22.         # ksh workaround
  23.         EUID=`id -u`
  24.         UID=`id -ru`
  25.     fi
  26.     USER="`id -un`"
  27.     LOGNAME=$USER
  28.     MAIL="/var/spool/mail/$USER"
  29. fi

  30. # Path manipulation
  31. if [ "$EUID" = "0" ]; then
  32.     pathmunge /sbin
  33.     pathmunge /usr/sbin
  34.     pathmunge /usr/local/sbin
  35. else
  36.     pathmunge /usr/local/sbin after
  37.     pathmunge /usr/sbin after
  38.     pathmunge /sbin after
  39. fi

  40. HOSTNAME=`/bin/hostname 2>/dev/null`
  41. HISTSIZE=1000
  42. if [ "$HISTCONTROL" = "ignorespace" ] ; then
  43.     export HISTCONTROL=ignoreboth
  44. else
  45.     export HISTCONTROL=ignoredups
  46. fi

  47. export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

  48. # By default, we want umask to get set. This sets it for login shell
  49. # Current threshold for system reserved uid/gids is 200
  50. # You could check uidgid reservation validity in
  51. # /usr/share/doc/setup-*/uidgid file
  52. if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
  53.     umask 002
  54. else
  55.     umask 022
  56. fi

  57. for i in /etc/profile.d/*.sh ; do
  58.     if [ -r "$i" ]; then
  59.         if [ "${-#*i}" != "$-" ]; then
  60.             . "$i"
  61.         else
  62.             . "$i" >/dev/null 2>&1
  63.         fi
  64.     fi
  65. done

  66. unset i      
  67. unset pathmunge



  68. unset -f pathmungeunset MAILCHECK
复制代码

作者: admin    时间: 2013-9-21 11:37

有改过
/etc/profile
这个文件?
作者: 喜欢眺望远处    时间: 2013-9-21 13:24

unset -f pathmungeunset MAILCHECK
好像就在最后加过这个

但是去掉了 也没用
作者: 喜欢眺望远处    时间: 2013-9-24 15:48

unset -f pathmungeunset MAILCHECK
好像就在最后加过这个

但是去掉了 也没用
作者: admin    时间: 2013-9-24 16:43

根据提示一个个修复试试
作者: 喜欢眺望远处    时间: 2013-9-24 23:23

我不懂linux,你能给我一个刚装好的 profile 文件内容?
作者: 喜欢眺望远处    时间: 2013-9-25 15:58

我不懂linux,你能给我一个刚装好的 profile 文件内容?
作者: 喜欢眺望远处    时间: 2013-9-26 19:50

我不懂linux,你能给我一个刚装好的 profile 文件内容?




欢迎光临 WDlinux官方论坛 (http://wdlinux.cn/bbs/) Powered by Discuz! 7.2