dimanche 18 janvier 2015

Bash script : Unexpected End Of File (FreeBSD)


I got a task to create a bash script to install Subversion scheduler on my freebsd machine, unfortunately it doesn't work as expected.


when I run



#bash -x ./installSubversion.sh


I always got this error messages



+ REPOPATH=$'/usr/ports/devel/subversion\r'
+ CHECKPATH=$'/usr/local/bin/svnserve\r'
>./installSubversion.sh: line 22: syntax error: unexpected end of file


here is the script installSubversion.sh



#!/usr/bin/env bash
###########
### Installing subversion(svn) on Freebsd
###########
REPOPATH="/usr/ports/devel/subversion"
CHECKPATH="/usr/local/bin/svnserve"
if [ ! -x "$CHECKPATH" ] || [ "$1" = "-force" ] ;
then
echo "Trying to install subversion from ports"
if [ "$1" = "-force" ];
then
/usr/sbin/pkg_delete -fx subversion-
cd $REPOPATH
/usr/bin/make -DBATCH reinstall clean
else
cd $REPOPATH
/usr/bin/make -DBATCH install clean
fi
else
echo "subversion is Installed"
fi


What am i doing wrong?



Aucun commentaire:

Enregistrer un commentaire