Make /bin/sh Syntax Error Unterminated Quoted String
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this syntax error: unterminated quoted string xampp site About Us Learn more about Stack Overflow the company Business Learn more syntax error: unterminated quoted string python about hiring developers or posting ads with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix syntax error: unterminated quoted string docker & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute: Sign up Here's how it works: docker /bin/sh: 1: syntax error: unterminated quoted string Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top sh -c: Unterminated quoted string error [duplicate] up vote 2 down vote favorite This question already has an answer here: Quoting in a function results in error 1 answer I've spent hours trying to understand the following error. My Script CMD="sh -c 'echo \"a\"'" $CMD Error: "a"':
Phantomjs Syntax Error Unterminated Quoted String
1: "a"': Syntax error: Unterminated quoted string of course when I do echo $CMD and paste the result, it works as expected... What is the cause of the error? Edit: I'm asking for an explanation not only a workaround. Therefore, I think the following link doesn't answer my question: Quoting in a function results in error bash shell quoting escape-characters share|improve this question edited Mar 14 '15 at 10:28 asked Mar 13 '15 at 19:05 klarezz 1414 marked as duplicate by Gillesbash Users with the bash badge can single-handedly close bash questions as duplicates and reopen them as needed. Mar 13 '15 at 22:51 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. add a comment| 2 Answers 2 active oldest votes up vote 2 down vote That cannot work. When your shell performs word splitting, you will have four arguments: sh -c 'echo "a"' To accomplish this, you must use a bash array: cmd=( sh -c 'echo "a"' ) "${cmd[@]}" share|improve this answer answered Mar 13 '15 at 19:18 glenn jackman 33.3k24072 Thanks, I didn't know aboud word
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack
Makefile Syntax Error: Unterminated Quoted String
Overflow the company Business Learn more about hiring developers or posting ads with us syntax error: unterminated quoted string heroku Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a syntax error: unterminated quoted string android community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why I got “sh: 1: Syntax error: Unterminated quoted string” when I run my Python http://unix.stackexchange.com/questions/190008/sh-c-unterminated-quoted-string-error program? up vote 1 down vote favorite I want to count how many lines of code I have written. Here is the Python code: import os import sys EXT = ['.c','.cpp','.java','.py'] def main(): l = [] if os.path.isdir(sys.argv[1]): for root, dirs, files in os.walk(sys.argv[1]): l.extend([os.path.join(root, name) for name in files]) else: l.append(sys.argv[1]) params = ["'"+p+"'" for p in l if os.path.splitext(p)[1] in EXT] result = os.popen("wc -l %s "%" ".join(params)).read() print http://stackoverflow.com/questions/18544112/why-i-got-sh-1-syntax-error-unterminated-quoted-string-when-i-run-my-python result if __name__ == '__main__': main() Before this, it was running as expected. But today, it give me this error: sh: 1: Syntax error: Unterminated quoted string I don't know what happened. python shell share|improve this question edited Feb 17 '14 at 17:09 nisargshah95 359422 asked Aug 31 '13 at 3:12 maemual 1114 2 How are you executing this script? –Johnsyweb Aug 31 '13 at 3:17 @Johnsyweb python program.py . –maemual Aug 31 '13 at 3:42 1 Try adding print params before your popen line. Do any of the elements in params have a single quote in them? –SethMMorton Aug 31 '13 at 5:09 2 you should also consider using the newer subprocess module instead of popen –sapi Aug 31 '13 at 5:52 @sapi THX, i wil try it. –maemual Sep 1 '13 at 2:57 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted Your Python script is missing a shebang line. Add the following to the top of your file: #!/usr/bin/env python Then you should be able to run the following, assuming your script is at /path/to/your_script.py and it has the executable bit set: /path/to/your_script.py arg1 arg2 [...] Alternatively: python /path/to/your_script.py arg1 arg2 [...] Update following comm
Sign in Pricing Blog Support Search GitHub This repository Watch 150 Star 770 Fork 345 Medium/phantomjs Code Issues 43 Pull requests 0 Projects 0 Pulse Graphs New https://github.com/Medium/phantomjs/issues/392 issue Unterminated quoted string syntax error when running inside Docker #392 Closed seanemmer opened this Issue Oct 5, 2015 · 8 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 6 participants seanemmer commented Oct 5, 2015 Error code is as follows: at ChildProcess.exithandler (child_process.js:658:15) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:766:16) at Process.ChildProcess._handle.onexit (child_process.js:833:5) Error: Command syntax error failed: /home/agepath/node_modules/mean-seo/node_modules/phantomjs/lib/phantom/bin/phantomjs: 4: /home/agepath/node_modules/mean-seo/node_modules/phantomjs/lib/phantom/bin/phantomjs: Syntax error: Unterminated quoted string siboulet commented Oct 13, 2015 @seanemmer I've been using the phantomjs module inside Docker containers for months without issues. Are you sure this is not an issue with the mean-seo module you're using? Can you provide more information how to reproduce this issue using plain phantomjs? What version of phantomjs package and what version unterminated quoted string of Node are you using? What platform are you on? seanemmer commented Oct 14, 2015 @siboulet the error suggests the issue originates from the phantomjs binary - I'll try to replicate it in phantom on a standalone basis. In the meantime - here's the environment, let me know if there's any glaring issues: Node 0.12 64bit Amazon Linux 2015.03 v2.0.0 running Docker 1.6.2 (AWS Elastic Beanstalk) wilmoore commented Oct 17, 2015 I can confirm that I see the same error within a docker container built via FROM node:4.2.1: ❯ docker run --rm -it $(basename $PWD) node_modules/.bin/phantomjs --version /app/node_modules/phantomjs/lib/phantom/bin/phantomjs: 4: /app/node_modules/phantomjs/lib/phantom/bin/phantomjs: Syntax error: Unterminated quoted string siboulet commented Oct 22, 2015 @wilmoore haven't had a chance to test under 4.2.1 yet, but am not having any issue under Docker hub image node:0.12-onbuild (Node v0.12.7). wilmoore commented Oct 22, 2015 Thanks for the info @siboulet. I ended up switching to npm install phantomjs-bin --save-dev which is working well. 👍 1 lvarayut commented Nov 9, 2015 I'm getting this error while running inside a docker machine using Ubuntu 14.04 with Node v0.12.7. 09 11 2015 04:01:14.071:INFO [karma]: Karma v0.13.15 server starte