# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
ORACLE_HOSTNAME=localhost.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
此代码返回 庆典:出口:`CLASSPATH':不是一个有效的标识符甲骨文的bash:出口:`CLASSPATH ':不是一个有效的标识符
我尝试安装Oracle 11.2.0克甲骨文在linux 6.0
使用bash -x返回
[[email protected] ~]$ bash -x .bash_profile
+ '[' -f /home/oracle/.bashrc ']'
+ . /home/oracle/.bashrc
++ '[' -f /etc/bashrc ']'
++ . /etc/bashrc
+++ '[' '' ']'
+++ shopt -q login_shell
+++ '[' 500 -gt 199 ']'
++++ /usr/bin/id -gn
++++ /usr/bin/id -un
+++ '[' oracle = oracle ']'
+++ umask 002
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/colorls.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/colorls.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/cvs.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/cvs.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/glib2.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/glib2.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/gnome-ssh-askpass.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/gnome-ssh-askpass.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/lang.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/lang.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/less.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/less.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/qt.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/qt.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/udisks-bash-completion.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/udisks-bash-completion.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/vim.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/vim.sh
+++ for i in '/etc/profile.d/*.sh'
+++ '[' -r /etc/profile.d/which2.sh ']'
+++ '[' '' ']'
+++ . /etc/profile.d/which2.sh
+++ unset i
+++ unset pathmunge
+ PATH=/u01/app/oracle/product/11.2.0/db_1/bin:/u01/app/oracle/product/11.2.0/db_1/bin:/u01/app/oracle/product/11.2.0/db_1/bin:/u01/app/oracle/product/11.2.0/db_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/home/oracle/bin:/home/oracle/bin:/home/oracle/bin:/home/oracle/bin:/home/oracle/bin
+ export PATH
+ ORACLE_HOSTNAME=localhost.localdomain
+ export ORACLE_HOSTNAME
+ ORACLE_UNQNAME=orcl
+ export ORACLE_UNQNAME
+ ORACLE_BASE=/u01/app/oracle
+ export ORACLE_BASE
+ ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
+ export ORACLE_HOME
+ ORACLE_SID=orcl
+ export ORACLE_SID
+ PATH=/u01/app/oracle/product/11.2.0/db_1/bin:/u01/app/oracle/product/11.2.0/db_1/bin:/u01/app/oracle/product/11.2.0/db_1/bin:/u01/app/oracle/product/11.2.0/db_1/bin:/u01/app/oracle/product/11.2.0/db_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/home/oracle/bin:/home/oracle/bin:/home/oracle/bin:/home/oracle/bin:/home/oracle/bin
+ export PATH
+ LD_LIBRARY=/u01/app/oracle/product/11.2.0/db_1/lib:/lib:/usr/lib
+ export LD_LIBRARY
+ CLASSPATH=/u01/app/oracle/product/11.2.0/db_1/jlib:/u01/app/oracle/product/11.2.0/db_1/rdbms/jlib
+ export $'CLASSPATH\357\273\277'
.bash_profile: line 22: export: `CLASSPATH': not a valid identifier
bash的-x在终端返回上面这段代码,在22行,我使用Oracle的Linux 6.0和Oracle 11.2.0g详细详细详细详细详细详细详细详细详细详细详细详细详细细节
与运行脚本'bash的-x yourscript'所以它会为他们打印命令'重新执行,并将结果写入问题。可能在'CLASSPATH'旁边有一个隐藏的字符,所以它实际上试图导出类似'CLASSPATH $'\ r'' –
的顺序,片段支持用于可以在Web浏览器内运行的代码 - 使用'{}编辑器中的'按钮来语法高亮显示其他语言。 –
(...另一方面,一个给定的变量只需要导出一次 - 将来的变化将被自动复制到环境中 - 并且对于shell初始化脚本,PATH是*在您的shell启动之前*已经*导出;'一遍又一遍地导出'是不需要的)。 –