使用 cygwin 终端,我的 .bashrc 中有以下内容:
export WINHOME="/cygdrive/c/Users/userName"
export TUTORING="$WINHOME/Desktop/Coding\ Projects/Tutoring/"
Run Code Online (Sandbox Code Playgroud)
当我打开 cygwin 时,会发生以下情况:
$ cd $TUTORING
-bash: cd: too many arguments
Run Code Online (Sandbox Code Playgroud)
然后我尝试了:
$ echo $TUTORING
/cygdrive/c/Users/userName/Desktop/Coding\ Projects/Tutoring
Run Code Online (Sandbox Code Playgroud)
复制粘贴 echo 的输出:
cd /cygdrive/c/Users/userName/Desktop/Coding\ Projects/Tutoring
Run Code Online (Sandbox Code Playgroud)
这似乎有效。知道为什么 cd 我的变量有问题吗?
cygwin ×1