gpt4 book ai didi

bash - 为什么我一直收到 `bash: local: command not found`

转载 作者:行者123 更新时间:2023-11-29 09:40:17 26 4
gpt4 key购买 nike

不断收到此错误:

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 $PURPLE@ $GREEN\w $BLUE[\#] → $RESETCOLOR"
export PS2="| → $RESETCOLOR"
}

# prompt

export PATH=/usr/local/bin:$PATH

source ~/.git-completion.bash

最佳答案

如果 local 确实不可用(例如,使用 enable -n local 禁用),您将看到:

bash: local: command not found

代替:

bash:   local: command not found

那些额外的空格是一个线索。仔细查看您的文件(如果需要,可以使用十六进制编辑器),找出那些既不是空格也不是制表符的字节实际上...并将它们更改为真正的 ASCII 空格字符。

在 Unicode 中发现了几种不间断的空格变体;我猜他们以某种方式进入了您的脚本。从 Web 复制和粘贴代码可能很危险。 :)

关于bash - 为什么我一直收到 `bash: local: command not found`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26289233/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com