Swan-Cygwinでこのエラーが発生するのはなぜですか?

Swan-Cygwinでこのエラーが発生するのはなぜですか?

使っています白鳥私のWindowsコンピュータでLinuxをサポートしています。

「Swan Terminal」(Xfce4/bash)を開くのに小さな問題があります。

起動時に次のエラーが発生します。

-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected
-bash: [: /home/Michael: binary operator expected

私のアカウント名(「Michael Wilcox」)の間のスペースが原因であると考える理由があります。

Swanの私のホームフォルダへの現在のパス:

C:\Users\Michael Wilcox\AppData\Roaming\Swan

白鳥のインストール:

C:\ProgramData\Swan

この問題を解決する方法を知っている人はいますか?

修正する: 詳細を見ると、.xsessions-errors の内容は次のとおりです。

/etc/X11/xinit/xinitrc-common: line 20: [: /home/Michael: binary operator expected
/usr/bin/startxfce4: line 111: [: /home/Michael: binary operator expected
/usr/bin/startxfce4: line 113: [: /home/Michael: binary operator expected
/etc/xdg/xfce4/xinitrc: line 67: test: /home/Michael: binary operator expected
/etc/xdg/xfce4/xinitrc: line 88: test: /home/Michael: binary operator expected

xinitrc - 共通:https://ghostbin.com/paste/7bn7x
Xfce4を起動します。https://ghostbin.com/paste/zfxoe
/etc/xdg/xfce4/xinitrc:https://ghostbin.com/paste/uw4tq
.bashrc:https://ghostbin.com/paste/4ojjj

ベストアンサー1

お分かりのように、新しいシェルが開かれるたびに実行されるスクリプトの1つは、$ HOMEにスペースを含むクエリを実行しているようですが、これはお勧めできません。

xinitrc-common - 次の行を含みます。

[ -r $HOME/.profile ] && . $HOME/.profile

startxfce4 - 次の行を含みます。

if test "x$XDG_CONFIG_HOME" = "x" 
then 
  BASEDIR="$HOME/.config/xfce4/" 
else 
  BASEDIR="$XDG_CONFIG_HOME/xfce4" fi

/etc/xdg/xfce4/xinitrc - 次の行を含みます。

if test "x$XDG_CONFIG_HOME" = "x" ; then 
  XDG_CONFIG_HOME=$HOME/.config 
fi 
[ -d "$XDG_CONFIG_HOME" ] || mkdir "$XDG_CONFIG_HOME"

これらの場所の$ HOME関連パラメーターは、スペースを含むパスとして引用する必要があります。

これらのパラメータを引用する必要があります。

たとえば、$HOME次のように変更します。"$HOME"

""を使用すると、シェルは "C:\Users\Michael Wilcox\"が文字列であることを認識します。

おすすめ記事