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?
;) and a newline before thethenpart of anifstatement. Have you deleted the innerif ... fito try and get the same error message?fi\rdoes not end an ifthenis on the next line. Care to elaborate?\rat the end of a line, others consider it a feature. :)