当我打开一个新终端时,我得到:bash:install_path:没有这样的文件或目录
我的 .bashrc 文件包含以下代码:
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# 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
# 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 ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
source /opt/ros/hydro/setup.bash
source ~/catkin_ws/devel/setup.bash
export LD_LIBRARY_PATH=<install_path>/local/lib:/home/enova6/catkin_ws/devel/lib:/opt/ros/hydro/lib
export PATH=<install_path>/local/bin:/home/enova6/catkin_ws/devel/bin:/opt/ros/hydro/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
export PKG_CONFIG_PATH=<install_path>/local/lib/pkgconfig:/home/enova6/catkin_ws/devel/lib/pkgconfig:/opt/ros/hydro/lib/pkgconfig
source ~/catkin_ws/devel/setup.bash
source /opt/ros/hydro/setup.bash
我为什么会遇到这个问题?我该如何解决它?
答案1
每当您打开新的终端(非登录 shell)时,该.bashrc
文件都会从文件中获取。文件 中的问题在终端上显示为错误。.bashrc 中有错误的行。您需要从中删除。 您可以做的是:.profile
.bashrc
<install_path>
1)将此行放在顶部:
install_path=/opt
注意:您需要放置一个适合您的路径。/opt 仅仅是一个例子。
2)删除对 的所有引用<install_path>
,$install_path
例如,
export LD_LIBRARY_PATH=$install_path/local/lib:/home/enova6/catkin_ws/devel/lib:/opt/ros/hydro/lib