I have script:
#!/bin/sh
PSQLPATH=$1
USER=$2
if [ -z ${PSQLPATH} ]; then
echo "incorrect path param"
echo "Usage: $0 psqlpath username"
exit 1
fi
if [ -z ${USER} ]; then
echo "incorrect username param"
echo "Usage: $0 psqlpath username"
exit 1
fi
${PSQLPATH}/createdb -h localhost -U ${USER} highway2
${PSQLPATH}/psql -f createDatatable.sql -h localhost -d highway2 -U ${USER}
${PSQLPATH}/psql -f insertStatements.sql -h localhost -d highway2 -U ${USER}
echo "execute passed"
exit 0
When I am trying to execute it like ./script.sh I got an error line 19: unexpected end of file. What I am doing wrong?