請收到此錯誤:爲什麼我不斷收到`慶典:本地:命令不found`
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: local: command not found
bash: export: command not found
bash: export: command not found
bash: ~/.bash_profile: No such file or directory
這裏是我的.bash_profile:
當我註釋掉提示功能,錯誤消失除了最後一個!
alias ngrok=/Users/mmahalwy/Desktop/Code/ngrok
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias ls='ls -GFh'
function prompt {
local BLACK="\[\033[0;30m\]"
local BLACKBOLD="\[\033[1;30m\]"
local RED="\[\033[0;31m\]"
local REDBOLD="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local GREENBOLD="\[\033[1;32m\]"
local YELLOW="\[\033[0;33m\]"
local YELLOWBOLD="\[\033[1;33m\]"
local BLUE="\[\033[0;34m\]"
local BLUEBOLD="\[\033[1;34m\]"
local PURPLE="\[\033[0;35m\]"
local PURPLEBOLD="\[\033[1;35m\]"
local CYAN="\[\033[0;36m\]"
local CYANBOLD="\[\033[1;36m\]"
local WHITE="\[\033[0;37m\]"
local WHITEBOLD="\[\033[1;37m\]"
local RESETCOLOR="\[\e[00m\]"
export PS1="\n$RED\u [email protected] $GREEN\w $BLUE[\#] → $RESETCOLOR"
export PS2="| → $RESETCOLOR"
}
# prompt
export PATH=/usr/local/bin:$PATH
source ~/.git-completion.bash
你確定這是由'bash'解釋,而不是像'dash'這樣的另一個shell嗎? – 2014-10-09 23:00:24
@ExplosionPills我該如何檢查? – 2014-10-09 23:06:43
'本地'是一個Bash builtins。從技術上講,可以通過編寫'enable -n local'來禁用它(並通過編寫'enable local'來重新啓用),但是有人會這樣做是很奇怪的。 (和'export'類似。) – ruakh 2014-10-09 23:13:08