最近私はUbuntu 11.04の/ etc/profileに次のbash関数定義を追加しました(CDコマンドを特定の開発ディレクトリにショートカットする機能です)。私はこれを行うならば、私はGnomeのにログインすることができません/etc/profileに関数を追加すると、ログイン後にgnomeが再起動されます
################## JMOZTELEPORT BEGIN ##################
function JMozTeleport() {
version=0.4.58
pathtopythonpackages=`python -c "from site import getsitepackages; print getsitepackages()[0]"`
pathtopythonteleport="$pathtopythonpackages/JMozTools-$version-py2.7.egg/JMozTools/JMozTeleport.py"
# $1 is the command to run
isversion=0
ishelp=0
if [[ "$1" == "-v" || "$1" == "--version" ]]
then
isversion=1;
fi
if [[ "$1" == "-h" || "$1" == "--help" ]]
then
ishelp=1;
fi
if [ -z $1 ]
then
python "$pathtopythonteleport" "-h"
elif [ $1 == "version" ]
then
echo $version
elif [ $isversion == 1 -o $ishelp == 1 ]
then
python "$pathtopythonteleport" "[email protected]"
else
cd $(python "$pathtopythonteleport" "[email protected]")
fi
}
################### JMOZTELEPORT END ###################
は、しかし、(ターミナルシェルからIソースは/ etc/profile場合は正常に動作しています)。それはokでログインしますが、すぐにGnomeを閉じてログイン画面に戻ります。私の/ etc/profileからこのファイルを削除しても、再度ログインすることができます。
これが原因でgnomeが再起動されているのは混乱しています。問題はどこにあるのか?
ありがとう。私は/ etc/bashrcに置いてしまいました。 – jwir3