i have the following function in my "update.sh" File:
#!/bin/bash
updateSymfony()
{
path=/var/www/symfony
echo "Falls der Symfony-Pfad abweichend von /var/www/symfony ist, geben Sie in bitte hier an, ansonsten nur Enter drücken"
echo " "
read pathanswer
echo $path
echo $pathanswer
if [ -n $pathanswer ]
then
if [ $pathanswer!="" ]
then
if [ $pathanswer!=" " ]
then
if [ -d "$pathanswer" ]
then
$path=$pathanswer
else
echo "Leider existiert der Pfad $pathanswer nicht"
return
fi
fi
fi
fi
if [ -d "$path" ]; then
cp $path $path-backup -R
cd $path
php composer.phar selfupdate
php composer.phar update
clearCache
clearCacheProd
setOwner
else
echo "Es wurde kein Symfony gefunden"
fi
}
I wanna ask if the prompt-answer is empty. This should be when i push the Enter-Key. But my if's didn't response the right answer.
What i am doing wrong?