3
我寫了下面的.bashrc:的.bashrc如果:表達式語法錯誤
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
function up()
{
LIMIT=$1
P=$PWD
for ((i=1; i <= LIMIT; i++))
do
P=$P/..
done
cd $P
export MPWD=$P
}
function back()
{
LIMIT=$1
P=$MPWD
for ((i=1; i <= LIMIT; i++))
do
P=${P%/..}
done
cd $P
export MPWD=$P
}
然而,保存,當我做source .bashrc
後,我得到了以下錯誤:if: Expression Syntax.
我在做什麼錯?我GOOGLE了一段時間,但無濟於事。
檢查你的shell是否使用echo $ SHELL – JohnTortugo
@JohnTortugo謝謝,我使用c shell並在bashrc中進行了更改。 – Chani