当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 17 篇帖子 ]  前往页数 1, 2  下一页
作者 内容
1 楼 
 文章标题 : bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-28 22:48 
头像

注册: 2008-06-22 13:38
帖子: 1627
地址: 武汉
送出感谢: 0 次
接收感谢: 0 次
每次打开终端就会有以下的一行提示现于首行

不知道是什么意思

能否解决下??

bash: #alias:找不到命令


_________________
mint+gnome


页首
 用户资料  
 
2 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 12:45 
头像

注册: 2008-06-22 13:38
帖子: 1627
地址: 武汉
送出感谢: 0 次
接收感谢: 0 次
自己顶上

求解中………………


_________________
mint+gnome


页首
 用户资料  
 
3 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 13:20 
头像

注册: 2007-09-29 3:09
帖子: 5773
送出感谢: 0 次
接收感谢: 3
贴你的~/.bashrc和~/.bash_profile


_________________
HUNT Unfortunately No Talent...


页首
 用户资料  
 
4 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 16:00 
头像

注册: 2008-06-22 13:38
帖子: 1627
地址: 武汉
送出感谢: 0 次
接收感谢: 0 次
~/.bashrc

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

#if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
#fi


alias zhcon='zhcon --utf8 --drv=vga'
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
alias ll='ls -l'



后者为空文件


_________________
mint+gnome


页首
 用户资料  
 
5 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 17:18 
头像

注册: 2007-09-29 3:09
帖子: 5773
送出感谢: 0 次
接收感谢: 3
alias应该是shell builtin的命令
配置文件也没看出问题啊...


_________________
HUNT Unfortunately No Talent...


页首
 用户资料  
 
6 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 22:11 

注册: 2008-05-24 8:30
帖子: 1453
送出感谢: 2
接收感谢: 30
提示的不是 alias 找不到,是 # alias 找不到。但 # 应该是开始一个注释的,不该报这个错误。如果上面贴的代码是直接 copy 过来的,实在想不出是什么原因,否则可以看看是否用了全角字符。


页首
 用户资料  
 
7 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 22:16 
头像

注册: 2008-06-22 13:38
帖子: 1627
地址: 武汉
送出感谢: 0 次
接收感谢: 0 次
是直接拷过来的……………………

难道真的没有办法了么??


_________________
mint+gnome


页首
 用户资料  
 
8 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 22:25 

注册: 2008-05-24 8:30
帖子: 1453
送出感谢: 2
接收感谢: 30
还有就是调试一下
代码:
bash -v

仔细看一下到哪报错了。


页首
 用户资料  
 
9 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 22:33 
头像

注册: 2008-06-22 13:38
帖子: 1627
地址: 武汉
送出感谢: 0 次
接收感谢: 0 次
不是太明白,请你看一下…………

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# ;;
#*)
# ;;
#esac
#alias zhcon='zhcon --utf8 --drv=vga'
bash: #alias:找不到命令
# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi

# sudo hint
if [ ! -e $HOME/.sudo_as_admin_successful ]; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

EOF
fi
esac
fi

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found ]; then
function command_not_found_handle {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found -- $1
return $?
else
return 127
fi
}
fi
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
SHELL=/bin/sh lesspipe
export LESSOPEN="| /usr/bin/lesspipe %s";
export LESSCLOSE="/usr/bin/lesspipe %s %s";

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

#if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
#fi


alias zhcon='zhcon --utf8 --drv=vga'
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
# bash_completion - programmable completion functions for bash 3.x
# (backwards compatible with bash 2.05b)
#
# $Id: bash_completion,v 1.872 2006/03/01 16:20:18 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The latest version of this software can be obtained here:
#
# http://www.caliban.org/bash/index.shtml#completion
#
# RELEASE: 20060301

if [[ $- == *v* ]]; then
BASH_COMPLETION_ORIGINAL_V_VALUE="-v"
else
BASH_COMPLETION_ORIGINAL_V_VALUE="+v"
fi

if [[ -n $BASH_COMPLETION_DEBUG ]]; then
set -v
else
set +v
fi
unset BASH_COMPLETION_ORIGINAL_V_VALUE

### Local Variables:
### mode: shell-script
### End:
alias ll='ls -l'
echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"


_________________
mint+gnome


页首
 用户资料  
 
10 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 22:44 

注册: 2008-05-24 8:30
帖子: 1453
送出感谢: 2
接收感谢: 30
哈哈,确实用了个全角的#号。但是在你早先贴的代码中我没找到,你再找找在哪个文件中。
[code# ;;
#esac
#alias zhcon='zhcon --utf8 --drv=vga'
bash: #alias:找不到命令
# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi][/code]


页首
 用户资料  
 
11 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 22:54 
头像

注册: 2008-06-22 13:38
帖子: 1627
地址: 武汉
送出感谢: 0 次
接收感谢: 0 次
sorry

不是太明白如何去找那个

不过alias zhcon='zhcon --utf8 --drv=vga'是我后来自己添加行去的,貌似是为了解决zhcon的中文问题的


_________________
mint+gnome


页首
 用户资料  
 
12 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 23:13 

注册: 2008-05-24 8:30
帖子: 1453
送出感谢: 2
接收感谢: 30
是你自己加进去的更好啊,更容易找到了。
这个 alias 没有问题,问题是前面加了个注释,加个注释不要紧,可偏偏用错了符号。
你看是不是那个井号比它上一行的井号要往里缩一点啊,用鼠标选一下,发现前后又确实没有空格,因为你用的是一个全角的井号。


页首
 用户资料  
 
13 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 23:27 
头像

注册: 2008-06-22 13:38
帖子: 1627
地址: 武汉
送出感谢: 0 次
接收感谢: 0 次
我现在把那一行自己添加的文字删除掉了

但是还是没有什么效果

样子依旧…………


_________________
mint+gnome


页首
 用户资料  
 
14 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 23:29 
头像

注册: 2008-06-22 13:38
帖子: 1627
地址: 武汉
送出感谢: 0 次
接收感谢: 0 次
http://hi.baidu.com/0soul/blog/item/ce2 ... f9d99.html

这位仁兄也是出现了一样的毛病,你可以看一下.


_________________
mint+gnome


页首
 用户资料  
 
15 楼 
 文章标题 : Re: bash: #alias:找不到命令 ??
帖子发表于 : 2008-12-29 23:42 
头像

注册: 2007-09-29 3:09
帖子: 5773
送出感谢: 0 次
接收感谢: 3
yilan198711 写道:
我现在把那一行自己添加的文字删除掉了

但是还是没有什么效果

样子依旧…………

重新登录时才读取


_________________
HUNT Unfortunately No Talent...


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 17 篇帖子 ]  前往页数 1, 2  下一页

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译