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 thethen
part of anif
statement. Have you deleted the innerif ... fi
to try and get the same error message? – Anthon Jan 18 at 8:09fi\r
does not end an if – Jasen Jan 18 at 8:49then
is on the next line. Care to elaborate? – Anthon Jan 18 at 8:52\r
at the end of a line, others consider it a feature. :) – PM 2Ring Jan 19 at 7:02