osx – -bash:export:`=’:不是有效的标识符

前端之家收集整理的这篇文章主要介绍了osx – -bash:export:`=’:不是有效的标识符前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_404_0@ 每次我打开我的终端,我会得到bellow错误
Last login: Sun Aug  4 17:23:05 on ttys000
-bash: export: `=': not a valid identifier
-bash: export: `/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MysqL/bin': not a valid identifier
-bash: export: `=': not a valid identifier
-bash: export: `/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MysqL/bin': not a valid identifier

这里是我的出口产出:

Calvin:~ sunkehappy$ export
declare -x Apple_PubSub_Socket_Render="/tmp/launch-4lEZNa/Render"
declare -x Apple_Ubiquity_Message="/tmp/launch-ukGAv5/Apple_Ubiquity_Message"
declare -x COMMAND_MODE="unix2003"
declare -x HOME="/Users/sunkehappy"
declare -x LANG="zh_CN.UTF-8"
declare -x LOGNAME="sunkehappy"
declare -x OLDPWD
declare -x PATH="/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
declare -x PWD="/Users/sunkehappy"
declare -x SECURITYSESSIONID="186a4"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_AUTH_SOCK="/tmp/launch-YAEryC/Listeners"
declare -x TERM="xterm-256color"
declare -x TERM_PROGRAM="Apple_Terminal"
declare -x TERM_PROGRAM_VERSION="309"
declare -x TERM_SESSION_ID="B134A404-D87F-4BB9-8A08-55F8CE923339"
declare -x TMPDIR="/var/folders/kt/pfw99tps22gg2019vz8k1zcm0000gn/T/"
declare -x USER="sunkehappy"
declare -x __CF_USER_TEXT_ENCODING="0x1F5:25:52"
当您执行以下操作时,不能在空格周围放置空格:
export foo=bar

删除你拥有的空间,你应该很好去。

如果输入:

export foo = bar

shell将解释为导出三个名称的请求:foo,=和bar。 =不是有效的变量名,所以命令失败。变量名称等号,它的值不能由空格分隔,以便作为同时分配和导出处理。

原文链接:https://www.f2er.com/bash/387558.html

猜你在找的Bash相关文章