Permission denied while executing ./sqoop_eval.sh

I am receiving this error when trying to run this:

[sabrynasroya@gw02 ~]$ ./sqoop_eval.sh
bash: ./sqoop_eval.sh: Permission denied

I have content already in sqoop_eval.sh txt file

Please help

@Sabryna_Sroya Can you share the code which is in sqoop_eval.sh file.

Change the mode of file using below command and lets us know.

chmod +x sqoop_eval.sh

@annapurna Hello, thank you. This is the content of sqoop_eval.sh txt file:

lines=cat ‘db.properties’
function setProperties() {
while read LINE
do
KEY= echo $LINE|cut -d= -f1
VALUE= echo $LINE|cut -d= -f2
if [ “$KEY” == “DBSERVER” ]; then
DBSERVER=${VALUE}
elif [ “$KEY” == “DBNAME” ]; then
DBNAME=${VALUE}
elif [ “$KEY” == “DBUSER” ]; then
DBUSER=${VALUE}
elif [ “$KEY” == “DBPASSWORD” ]; then
DBPASSWORD=${VALUE}
fi
done <<< “echo -e $lines”
}

function getCountForAllTables() {
cat listoftables|while read LINE
do
DBTABLE = ${LINE}
COUNT=sqoop eval
–connect jdbc:mysql://${DBSERVER}/${DBNAME}
–username ${DBUSER}
–password ${DBPASSWORD}
–query “select count(1) from ${DBTABLE}” 2>/dev/null
grep “^|”|grep -v count|cut -d" " -f2`
echo ${DBTABLE}:${COUNT}
done
}

When I ran the command that you provided, it changed and now the new output is this:

[sabrynasroya@gw02 ~]$ ./sqoop_eval.sh
./sqoop_eval.sh: line 1: db.properties: command not found
./sqoop_eval.sh: line 28: unexpected EOF while looking for matching ``'
./sqoop_eval.sh: line 32: syntax error: unexpected end of file

@Sabryna_Sroya There are some syntax mistakes in your script. You can follow the below link