si pas zshrc message plus complet

This commit is contained in:
hugodu69
2019-02-06 04:26:07 +01:00
parent 7ce0816902
commit 2285a63191

View File

@@ -11,8 +11,10 @@
SCREEN="$HOME/.screenrc"
MYSCREEN="$HOME/config/.screenrc"
VIM="$HOME/.vimrc"
MYVIM="$HOME/config/.vimrc"
ZSH="$HOME/.zshrc"
MYZSH="$HOME/config/.zshrc"
@@ -21,13 +23,15 @@ MYZSH="$HOME/config/.zshrc"
# action on the .screenrc file
# -------------------------------------------------------------
if [ -f $SCREEN ];
then
if grep -q '#hugogogo#' $SCREEN;
then
sed '/#hugogogo#/,/#hugogogo#/d' $SCREEN > $SCREEN.tmp && mv $SCREEN.tmp $SCREEN
if [ -f $SCREEN ]; then
if [ ! -L $SCREEN ]; then
if grep -q '#hugogogo#' $SCREEN;
then
sed '/#hugogogo#/,/#hugogogo#/d' $SCREEN > $SCREEN.tmp
mv $SCREEN.tmp $SCREEN
fi
cat $MYSCREEN >> $SCREEN
fi
cat $MYSCREEN >> $SCREEN
else
ln -s $MYSCREEN $SCREEN
fi
@@ -37,13 +41,15 @@ fi
# action on the .vimrc file
# -------------------------------------------------------------
if [ -f $VIM ];
then
if grep -q '"hugogogo"' $VIM;
then
sed '/"hugogogo"/,/"hugogogo"/d' $VIM > $VIM.tmp && mv $VIM.tmp $VIM
if [ -f $VIM ]; then
if [ ! -L $VIM ]; then
if grep -q '"hugogogo"' $VIM;
then
sed '/"hugogogo"/,/"hugogogo"/d' $VIM > $VIM.tmp
mv $VIM.tmp $VIM
fi
cat $MYVIM >> $VIM
fi
cat $MYVIM >> $VIM
else
ln -s $MYVIM $VIM
fi
@@ -57,10 +63,16 @@ if [ -f $ZSH ];
then
if grep -q '#hugogogo#' $ZSH;
then
sed '/#hugogogo#/,/#hugogogo#/d' $ZSH > $ZSH.tmp && mv $ZSH.tmp $ZSH
sed '/#hugogogo#/,/#hugogogo#/d' $ZSH > $ZSH.tmp
mv $ZSH.tmp $ZSH
fi
cat $MYZSH >> $ZSH
else
echo "install zsh to run the dynamic title on screen"
echo "you don't have a .zshrc file in your \$HOME directory"
echo "maybe you should verify if you have zsh :"
echo "run 'zsh --version'"
echo "and if not, install it, otherwise create a .zshrc file"
echo "now run the script README.txt again"
echo "to set the dynamic title on screen"
fi