Why I'm getting these Errors - unexpected EOF while looking for matching `)'
Your here document is terminated wrongly; either
- start the here document with
<<-EOF
and indent using tabs or - put
EOF
on a line without any other characters.
unexpected EOF while looking for matching `' syntax error: unexpected end of file
The problem is with your sed
command:
sed \'s/"//g\'
When you have \'
this is an escaped single quote. Then you later have a "
, and there are no more "
characters for the rest of the script. So bash
searches the rest of your script for the closing "
and fails to find it.
What I believe you meant to do was not escape the single quotes:
sed 's/"//g'
bash: -c: line 0: unexpected EOF while looking for matching ``'
This error:
bash: -c: line 0: unexpected EOF while looking for matching ``'
bash: -c: line 1: syntax error: unexpected end of file
Clearly indicates that whatever command is supposed to be feeding "deployment.sh" to bash, is not doing it correctly.
I would replace the whole "deployment.sh" script with a single echo "foobar"
or something equally simple just to make sure that the script runs. Then, I would dump all the environment variables env
to see if there's something funky.
Eventually check piece by piece that everything in "deployment.sh" is working correctly, and for starters others have already pointed out you have an issue at the beginning:
This:
echo $AWS_ACCESS_KEY_ID & echo $AWS_SECRET_ACCESS_KEY & echo $AWS_REGION & echo ""
Runs four commands in parallel, and the order of the output isn't guaranteed, which clearly would mess with aws configure
.
Instead use a heredoc:
aws configure <<EOF
$AWS_ACCESS_KEY_ID
$AWS_SECRET_ACCESS_KEY
$AWS_REGION
EOF
This shouldn't affect the rest of the script though.
Error : unexpected EOF while looking for matching `''
Try escaping double quotes as follows:
#!/bin/bash
cd /data/NEW
for f in User*
do
mysql --user="root" --password="user@123" -e "LOAD DATA LOCAL INFILE '/data/NEW/$f' ignore into table new.table2 fields terminated by ',' enclosed by '\"' lines terminated by '\n' (table_date, table_name, table_count);"
done
unexpected EOF while looking for matching `''
Try to use:
sudo docker exec $webproxy sh -c "$webproxycurl"
Also, as a side note, do not run docker in sudo
.
Add the docker group if it doesn't already exist:
sudo groupadd docker
Add the connected user "$USER" to the docker group. Change the user name to match your preferred user if you do not want to use your current user:
sudo gpasswd -a $USER docker
Either do a
newgrp docker
or log out/in to activate the changes to groups.You can use
docker run hello-world
to check if you can run docker without sudo.
Check this answer for more details.
Related Topics
Running a Program Through Ssh Fails with "Error Opening Terminal: Unknown."
How to Clone a Git Repository Which Is Present on a Remote Linux Server into Windows
Linux Select() and Fifo Ordering of Multiple Sockets
How to Use Named Mutex at Linux
Is There Some Ansible Equivalent to "Failed_When" for Success
Keep Ssh Sessions Running After Disconnection
Put Graphics on The Screen Without /Dev/Fb0
What Does "Warning: Not Changing User" Mean in Neo4J
How to Automatically Close The Execution of The 'Qemu' After End of Process
Debian Sources.List.D Versus Sources.List
Cannot Find Module 'Firebase-Admin' When Trying to Deploy Firebase Functions
"The Launch Timed Out and Was Terminated" Error with Bumblebee on Linux
Nohup Create New Files Nohup.Out by Day
Which Tool Has Replaced Gatttool in Bluez5
How to Search The Content of a PDF File in Linux Shell Script