Linked Questions
36 questions linked to/from here-document gives 'unexpected end of file' error
18
votes
1
answer
52k
views
Bash: warning: here-document at line delimited by end-of-file (wanted `EOF') [duplicate]
The following function in bash comes up with the error mentioned in the title. The error usually appears when the final EOF is not at the beginning of the line.
EOF is at the beginning so I can't ...
15
votes
3
answers
7k
views
Error when using a bash here-doc "unexpected end of file" [duplicate]
I get the following error that is flagging on the last line of my code (which is empty):
syntax error: unexpected end of file
I can't figure out why it's saying this. I'm simply trying to use a here-...
4
votes
3
answers
37k
views
line 54: warning: here-document at line 42 delimited by end-of-file (wanted `EOF') [duplicate]
I got bash script, but when I run it I got some error:
line 54: warning: here-document at line 42 delimited by end-of-file (wanted `EOF')
#!/bin/bash
echo "PODAJ IMIE"
read imie
echo "PODAJ ...
6
votes
2
answers
19k
views
Bash script: syntax error: unexpected end of file [duplicate]
I have the following file and I have chmod a+x on the file.
When I try to run it, I get a line 75: syntax error: unexpected end of file. What is the error with my script? What do I need to do to fix ...
chuacw's user avatar
- 1,883
3
votes
1
answer
26k
views
Unexpected EOF error while looking for matching `)' [duplicate]
Trying to run a bash script and while some things work correctly, I get this message:
line 34: unexpected EOF while looking for matching `)'
Here's the code, I've marked the line in question (in the ...
3
votes
2
answers
9k
views
Bash: How to avoid warning: here-document at line XX delimited by end-of-file (wanted `EOM') [duplicate]
I was a running a bash script fine on one of the linux host(bash version version 3.2.25(1)), since I have moved the script to another host (bash verison version 4.2.25(1)) it is throwing warning as
...
4
votes
2
answers
5k
views
Stuck with 'here document `EOF' unclosed' [duplicate]
I'm trying to write a bash script but I'm still getting this error:
here document `cmd' unclosed
I don't know what is wrong; please can you help?
#!/bin/bash
USER='login'
PASS='password'
echo $USER
...
0
votes
3
answers
8k
views
Nested for loop with cat EOF issues [duplicate]
Here is my code, I have two files where one contains file locations and other contains input name. I want to create a for-loop that works to incorporate both those files. I tried that here
#!/bin/...
0
votes
1
answer
4k
views
Ending EOF not detected [duplicate]
I have the following function;
function getdetails {
if ! "${PSQL_PATH}" -d "$DB" -U "$DB_USER" -h localhost -p "$DB_PORT" -t -c | while read -a Record ; do
taskid="${Record[0]}"
...
1
vote
2
answers
3k
views
How do I get EOT to work on IF ELSE statement in bash? [duplicate]
I'm trying to make a script that enables proxy settings if the /etc/environment file is currently empty and disables the settings if the file has text. I've written some code but not sure why the /etc/...
0
votes
1
answer
4k
views
Here document getting delimited by end-of-file error [duplicate]
I am getting the below error for my here document:
line 8: warning: here-document at line 4 delimited by end-of-file (wanted `START')
./appendJVM.sh: line 9: syntax error: unexpected end of file
...
0
votes
1
answer
3k
views
how to hide warning in bash script [duplicate]
I have a bash script I've been using for ages. It has a few lines it just start/stop some jobs in database. It is very simple and it never fails. Last year, it facts in December so a few days ago :) ...
0
votes
1
answer
2k
views
Syntax error: end of file unexpected (expecting fi) [duplicate]
I am writing a backup script.
I think my syntax is correct but it still gives me an error.
Here's my script:
if [ ! -f $LIST ]; then
/usr/bin/tar -g $FULLLIST -zpcf $FULL $TGT
cp $FULLLIST $...
1
vote
2
answers
693
views
heredoc gives 'unexpected end of file' error [duplicate]
I'm creating a Bash script file on iOS X that asks the user if they would like to upload a file to a server. The sftp command (with a delimiter) works fine outside the if statement but when I put the ...
-1
votes
1
answer
5k
views
cat EOF issues with indentation [duplicate]
I am not sure why it is such an hassle trying to cat content to file when the content is indented.
I am trying to close this heredoc block:
UserData:
"Fn::Base64":
!Sub |
#!/bin/...