Hello I am trying to run a loop and get the details of a project. I have these projects in my work space. How do I loop over the SQL code?
#!/bin/bash
workspace=$(sudo locate -r '/workspace$')
cd $workspace
echo "" > ~/Desktop/workspace.txt
for projectName in `ls -d *`;
do
echo $projectName >> ~/Desktop/workspace.txt
done
cat workspace.txt | while read Name
sqlplus $1/$2 <<ENDOFSQL > ~/Desktop/$Name.txt
DESC PROJECTS;
SELECT ID_NAME, VALUE FROM PROJECTS WHERE ID_NAME='%${Name}%';
exit;
ENDOFSQL
echo "Testing"
When I run it, I get the error
./sql_parameters.sh: line 24: syntax error: unexpected end of file