Skip to main content
deleted 30 characters in body
Source Link
Jeff Schaller
  • 68.9k
  • 35
  • 122
  • 268

I'm trying to execute a bash script and getting the "Unexpected EOF while looking for matching ' " ' error. Not sure where I'm messing up.

The script is designed to insert .md files as entries into a journal program. The journal program uses the following CLI code to insert each .md file: 'dayone2 -d="YYYY-MM-DD TT:TT" new < "filename". So the script extracts the date from the filename itself and runs the program as above.

#!/bin/bash
#
# October 11, 2015 - John Raymonds
#
for file in *.md
do
# do something on "$file"
year="$(echo "$file" | cut -c 13,14,15,16)"
day="$(echo "$file" | cut -c 18,19)"
month="$(echo "$file" | cut -c 21,22)"
theDate=\"$year"-"$month"-"$day" 12:00PM"\"
#The date should end up in this format "2017-01-24 12:00PM"
 
/usr/local/bin/dayone2 -d="$theDate" new < "$file"

rm "$file"
done

Any help whereWhere is the code is wrong would be appreciated!?

I'm trying to execute a bash script and getting the "Unexpected EOF while looking for matching ' " ' error. Not sure where I'm messing up.

The script is designed to insert .md files as entries into a journal program. The journal program uses the following CLI code to insert each .md file: 'dayone2 -d="YYYY-MM-DD TT:TT" new < "filename". So the script extracts the date from the filename itself and runs the program as above.

#!/bin/bash
#
# October 11, 2015 - John Raymonds
#
for file in *.md
do
# do something on "$file"
year="$(echo "$file" | cut -c 13,14,15,16)"
day="$(echo "$file" | cut -c 18,19)"
month="$(echo "$file" | cut -c 21,22)"
theDate=\"$year"-"$month"-"$day" 12:00PM"\"
#The date should end up in this format "2017-01-24 12:00PM"
 
/usr/local/bin/dayone2 -d="$theDate" new < "$file"

rm "$file"
done

Any help where the code is wrong would be appreciated!

I'm trying to execute a bash script and getting the "Unexpected EOF while looking for matching ' " ' error. Not sure where I'm messing up.

The script is designed to insert .md files as entries into a journal program. The journal program uses the following CLI code to insert each .md file: 'dayone2 -d="YYYY-MM-DD TT:TT" new < "filename". So the script extracts the date from the filename itself and runs the program as above.

#!/bin/bash
#
# October 11, 2015 - John Raymonds
#
for file in *.md
do
# do something on "$file"
year="$(echo "$file" | cut -c 13,14,15,16)"
day="$(echo "$file" | cut -c 18,19)"
month="$(echo "$file" | cut -c 21,22)"
theDate=\"$year"-"$month"-"$day" 12:00PM"\"
#The date should end up in this format "2017-01-24 12:00PM"
 
/usr/local/bin/dayone2 -d="$theDate" new < "$file"

rm "$file"
done

Where is the code wrong?

edited body
Source Link

I'm trying to execute a bash script and getting the "Unexpected EOF while looking for matching ' " ' error. Not sure where I'm messing up.

The script is designed to insert .md files as entries into a journal program. The journal program uses the following CLI code to insert each .md file: 'dayone2 -d="YYYY-MM-DD TT:TT" new < "filename". So the script extracts the date from the filename itself and runs the program as above.

#!/bin/bash
#
# October 11, 2015 - John Raymonds
#
for file in *.md
do
# do something on "$file"
year="$(echo "$file" | cut -c 13,14,15,16)"
day="$(echo "$file" | cut -c 18,19)"
month="$(echo "$file" | cut -c 21,22)"
theDate=\"$day"theDate=\"$year"-"$month"-"$year""$day" 12:00PM"\"
#The date should end up in this format "2017-01-24 12:00PM"
 
/usr/local/bin/dayone2 -d="$theDate" new < "$file"

rm "$file"
done

Any help where the code is wrong would be appreciated!

I'm trying to execute a bash script and getting the "Unexpected EOF while looking for matching ' " ' error. Not sure where I'm messing up.

The script is designed to insert .md files as entries into a journal program. The journal program uses the following CLI code to insert each .md file: 'dayone2 -d="YYYY-MM-DD TT:TT" new < "filename". So the script extracts the date from the filename itself and runs the program as above.

#!/bin/bash
#
# October 11, 2015 - John Raymonds
#
for file in *.md
do
# do something on "$file"
year="$(echo "$file" | cut -c 13,14,15,16)"
day="$(echo "$file" | cut -c 18,19)"
month="$(echo "$file" | cut -c 21,22)"
theDate=\"$day"-"$month"-"$year" 12:00PM"\"
#The date should end up in this format "2017-01-24 12:00PM"
 
/usr/local/bin/dayone2 -d="$theDate" new < "$file"

rm "$file"
done

Any help where the code is wrong would be appreciated!

I'm trying to execute a bash script and getting the "Unexpected EOF while looking for matching ' " ' error. Not sure where I'm messing up.

The script is designed to insert .md files as entries into a journal program. The journal program uses the following CLI code to insert each .md file: 'dayone2 -d="YYYY-MM-DD TT:TT" new < "filename". So the script extracts the date from the filename itself and runs the program as above.

#!/bin/bash
#
# October 11, 2015 - John Raymonds
#
for file in *.md
do
# do something on "$file"
year="$(echo "$file" | cut -c 13,14,15,16)"
day="$(echo "$file" | cut -c 18,19)"
month="$(echo "$file" | cut -c 21,22)"
theDate=\"$year"-"$month"-"$day" 12:00PM"\"
#The date should end up in this format "2017-01-24 12:00PM"
 
/usr/local/bin/dayone2 -d="$theDate" new < "$file"

rm "$file"
done

Any help where the code is wrong would be appreciated!

Source Link

Unexpected end of file while looking for `" script

I'm trying to execute a bash script and getting the "Unexpected EOF while looking for matching ' " ' error. Not sure where I'm messing up.

The script is designed to insert .md files as entries into a journal program. The journal program uses the following CLI code to insert each .md file: 'dayone2 -d="YYYY-MM-DD TT:TT" new < "filename". So the script extracts the date from the filename itself and runs the program as above.

#!/bin/bash
#
# October 11, 2015 - John Raymonds
#
for file in *.md
do
# do something on "$file"
year="$(echo "$file" | cut -c 13,14,15,16)"
day="$(echo "$file" | cut -c 18,19)"
month="$(echo "$file" | cut -c 21,22)"
theDate=\"$day"-"$month"-"$year" 12:00PM"\"
#The date should end up in this format "2017-01-24 12:00PM"
 
/usr/local/bin/dayone2 -d="$theDate" new < "$file"

rm "$file"
done

Any help where the code is wrong would be appreciated!