Makefile /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 site About Us Learn more syntax error unterminated quoted string xampp about Stack Overflow the company Business Learn more about hiring developers or posting
Docker /bin/sh: 1: Syntax Error: Unterminated Quoted String
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack makefile syntax error: unterminated quoted string Overflow is a 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 syntax error: unterminated quoted string python I run my Python 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 =
Syntax Error: Unterminated Quoted String Docker
os.popen("wc -l %s "%" ".join(params)).read() print 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/
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 phantomjs syntax error unterminated quoted string site About Us Learn more about Stack Overflow the company Business Learn more syntax error: unterminated quoted string heroku about hiring developers or posting ads with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix
Syntax Error: Unterminated Quoted String Android
& 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: http://stackoverflow.com/questions/18544112/why-i-got-sh-1-syntax-error-unterminated-quoted-string-when-i-run-my-python 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"': 1: http://unix.stackexchange.com/questions/190008/sh-c-unterminated-quoted-string-error "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 splittin
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code https://ubuntuforums.org/showthread.php?t=1093894 of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Official Flavours syntax error Support General Help [ubuntu] Getting "Syntax error: Unterminated quoted string" on execution. Having an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Results 1 to 4 of 4 Thread: Getting "Syntax error: Unterminated quoted string" on execution. Thread Tools unterminated quoted string Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode March 12th, 2009 #1 VotaVader View Profile View Forum Posts Private Message Just Give Me the Beans! Join Date Nov 2008 Location Chile Beans 48 DistroUbuntu 11.10 Oneiric Ocelot [SOLVED]Getting "Syntax error: Unterminated quoted string" on execution. I'm trying to configure System/161 for OS/161 (the virtual machine for a study operating system for academical purposes). Anyway, I'm following the steps provided in a course website for the installation of the program, but when I try to execute a configuration script, I get the error "Syntax error: Unterminated quoted string" independent of the arguments given. I opened the script with gedit and checked for the simplest execution but not even ./configure --help will work. Does anyone know what could be causing this problem? I've tried running it as root and as regular user. I'll post the terminal output and the code to the script: Code: pedro@pedro-laptop:~/Documents/UNSW/cs3231/sys161-1.14$ ./configure