获取 ~/.bashrc 修复了 PATH 问题,但弄乱了向上箭头以获取过去的命令

获取 ~/.bashrc 修复了 PATH 问题,但弄乱了向上箭头以获取过去的命令

我在我正在上的计算机科学课程中添加了这一行

export PATH=$PATH:/u/wbcowan/gnuarm4.0.2/libexec/gcc/armelf/4.0.2:/u/wbcowan/gnuarm-4.0.2/arm-elf/bin

到我的末尾~/.profile,这样我就不必每次都手动输入。

我试过了source ~/.profile,但是没有用,所以我又试了一下source ~/.bashrc让它工作了。

问题是,每当我按下向上箭头来获取过去的命令时,按下约 10 次后文本就会变得很奇怪。

例如,

make cleavi ~/.profile
make cleasource ~/.profile
make cleacd-

我的文件中只有一行.bashrc

shopt -s checkwinsize

编辑:

~/.profile 的输出是

# WARNING: For help understanding this file, and before you try
# to change any of it, type "man .profile" and read carefully.
#

#
# Set command search rules
#
if [ -x /bin/showpath ] ; then
    export PATH; PATH=`/bin/showpath /u/wbcowan/gnuarm-4.0.2/libexec/gcc/arm-elf/4.0.2 /u/wbcowan/gnuarm-4.0.2/arm-elf/bin standard`
#
# Find out what kind of terminal we are using
#
    eval `setterm -x default:vt100`
#
# Set terminal-type dependent options (e.g. sysline or prompt string)
#
    #HOMEHOST="<hostname>"
    #HOMEUSER="<userid>"
    #export HOMEHOST HOMEUSER
    PS1="`\setprompt`"
#
# Now do the usual signing on things
#
    export MAIL; MAIL=${MAIL-"/usr/spool/mail/$USER"}

    if [ -r /software/.admin/bins/bin/read_system_news ] ; then /software/.admin/bins/bin/read_system_news ; fi
fi

export MAIL; MAIL=${MAIL-"/usr/spool/mail/$USER"}
alias g++14="g++-5 -std=c++14"
alias vi="vi -X"
export EDITOR=vi
export PATH=$PATH:/u/wbcowan/gnuarm-4.0.2/libexec/gcc/arm-elf/4.0.2:/u/wbcowan/gnuarm-4.0.2/arm-elf/bin

的输出~/.bashrc

# This is an empty file. Older xhier/solaris dependant versions of this file
# in the share directory should NOT be used!
shopt -s checkwinsize

echo "$PS1"给出\W$

谢谢!

相关内容