LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-24-2018, 10:08 PM   #1
maheshreddy690
LQ Newbie
 
Registered: Dec 2018
Posts: 1

Rep: Reputation: Disabled
Command line execution error: unexpected EOF while looking for matching `"' bash: -c: line 25: syntax error: unexpected end of file


Hello All,

i am trying to execute below command in linux but it is failing with unexpected EOF while looking for matching `"' bash: -c: line 25: syntax error: unexpected end of file as i have a single quote in one of the fields of Json string. I tried escaping it by finishing already opened one ('), placing quote in another quote ("'"), then opening another one (') like "delivery_name":"UU'"'"'18 JUS OFI 159" and "delivery_name":"UU'\''18 JUS OFI 159".
When i escape it as above i am able to execute the command but the input to the R script is going as delivery_name` = 'UU\\'18 JUS OFI 159' so the query is not returning data. Can some one please help i am new to linux.

/usr/lib64/R/bin/Rscript /ap_data/D2O/BCI/scripts/ci_automation.R '{ "project_id":"828", "version_id":"2", "query_id":null, "country":"dz", "deliverable":"159JUS", "client_db_id":19631, "delivery_name":"UU'18 JUS OFI 159", "subtype":"trend", "mkt_tag":"A4", "prod_tag":[ "T00000001", "T00000025" ], "fact":[ "sales_volume", "sales_value", "distribution_numeric" ], "expectation":"decrease", "current_period":"NOV 2017", "reference_period":null, "scope":"ytd", "analysis_type":"market_analysis" }'
 
Old 12-25-2018, 01:13 PM   #2
Tonus
Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-current
Posts: 481
Blog Entries: 3

Rep: Reputation: 131Reputation: 131
Command line execution error: unexpected EOF while looking for matching `"' bash: -c: line 25: syntax error: unexpected end of file

You could have a look at the first answer here :
https://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Line 7 : syntax error near unexpected token ')' and Line 7: "option 1-?")" tiffney2018 Linux - Newbie 5 05-07-2016 03:35 PM
PHP Parse error: syntax error, unexpected end of file in Command line code on line 1 pizzipie Programming 8 12-11-2014 12:49 PM
Unexpected EOF while looking for matching `'' in bashrc with several aliases NewTom Linux - Newbie 5 09-27-2011 04:47 PM
Error in Bash: line 77: syntax error: unexpected end of file bribon Programming 8 07-13-2011 12:43 PM
Backup Script error "line 31: syntax error: unexpected end of file" eswanepoel General 7 12-07-2007 09:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration