Cron 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 about Stack Overflow the company Business Learn more about hiring developers
Sh: 1: Syntax Error: Unterminated Quoted String
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question makefile : syntax error: unterminated quoted string x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; docker /bin/sh: 1: syntax error: unterminated quoted string it only takes a minute: Sign up /bin/sh: Syntax error: Unterminated quoted string up vote 26 down vote favorite 2 I am trying to get a cronjob to pipe output into a dated file in a specified (folder) location. My
Docker Syntax Error: Unterminated Quoted String
crontab entry looks something like this: * * * * * /some/path/test.sh >> $(date "+/home/oompah/logs/%Y%m%d.test.log") What I don't understand is that when I type this command at the console, I get the correct string: echo $(date "+/home/oompah/logs/%Y%m%d.test.log") /home/oompah/logs/20110329.test.log What's causing this error and how may I fix it? bash version info is: GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu) bash ubuntu share|improve this question asked Mar 29 '11 at 14:09 oompahloompah 2,710114576 The $date() call is correct - the error's
Syntax Error Unterminated Quoted String Shell Script
most likely in your test.sh script. What's that look like? –Marc B Mar 29 '11 at 14:12 1 Belongs on askubuntu.com or unix.stackexchange.com –Let_Me_Be Mar 29 '11 at 14:20 test.sh simply contains this line echo 'Hello' I don't think that is the cause of the problem –oompahloompah Mar 29 '11 at 14:22 @Let_Me_Be: Although I can see your point, there is a real danger of SO spreading itself so thin, that it ends up with several "specialist" sites with no more than a few dozen or tops couple of hundred people to answer questions. This question is relevant here, because although I have kept it simple (for brevity and clarity), it could very easily broaden to include questions about Python and C++, which are the tasks being run by cron. –oompahloompah Mar 29 '11 at 14:34 Well, that is a discussion for meta. –Let_Me_Be Mar 29 '11 at 14:53 add a comment| 3 Answers 3 active oldest votes up vote 53 down vote accepted You should excape the percent signs in your crontab: * * * * * /some/path/test.sh >> $(date "+/home/oompah/logs/\%Y\%m\%d.test.log") Percent (%) signs have a special meaning in crontabs. They are interpreted as newline characters. share|improve this answer edited Feb 7 '12 at 21:59 Matthew Simoneau 3,58052542 answered Mar 29 '11 at 14:36 bmk 9,31242135 1 Thanks very much. This fixes the issue. I should actually h
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and sh: 1: syntax error: unterminated quoted string python policies of this site About Us Learn more about Stack Overflow the
Phantomjs Syntax Error Unterminated Quoted String
company Business Learn more about hiring developers or posting ads with us Unix & Linux Questions Tags Users Badges syntax error: unterminated quoted string eclipse Unanswered Ask Question _ Unix & 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 http://stackoverflow.com/questions/5473876/bin-sh-syntax-error-unterminated-quoted-string minute: Sign up Here's how it works: 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 http://unix.stackexchange.com/questions/190008/sh-c-unterminated-quoted-string-error error. My Script CMD="sh -c 'echo \"a\"'" $CMD Error: "a"': 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"' ) "${c
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 http://superuser.com/questions/678386/syntax-error-unterminated-quoted-string-running-run-file Overflow the company Business Learn more about hiring developers or posting ads with us https://forum.ubuntuusers.de/topic/cronjob-syntax-error-unterminated-quoted-strin/ Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Syntax syntax error error: Unterminated quoted string - running .run file up vote 2 down vote favorite 1 I am trying to run a .run file, I log in as SU and run the following command: sh xampp-linux-x64-1.8.3-1-installer.run but I am getting the following error: Syntax error: Unterminated quoted string What is the cause of this? installation debian crunchbang share|improve this question edited Nov 7 '14 at 13:38 Hennes 50.8k775120 asked Nov 20 '13 at unterminated quoted string 14:55 ColinShewell 1582312 The cause is stated (Syntax Error). Are you more interested in how to fix it? If so, is it plain text (can you cat *.run)? –nerdwaller Nov 20 '13 at 15:00 The output is just gibberish. –ColinShewell Nov 20 '13 at 15:03 add a comment| 4 Answers 4 active oldest votes up vote 4 down vote accepted The cause is probably an unterminated quoted string in the installer. (well duh!). Either run it with the -x option to get more debug information, or open the installer in an editor and look for unmatched pairs of quotes. Example: #!/usr/bin/env bash #My demo installer! # echo "starting here!" echo "and an error in this line echo "We will never get here!" Notice the missing closing quote (") in the second echo line. Edit: I just downloaded a file called xampp-linux-x64-1.8.3-1-installer.run from sourceforge (which I assume is the same file as you are using) and when I opened it in vim I noticed it starts with ^?ELF^. This file seems to be an ELF binary. Using the file command on it confirms this: file: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, stripped It is not a shell script and the normal way to execute
nur hier 24 Stunden nur hier 12 Stunden nur hier 6 Stunden nur hier Alle Foren als gelesen markieren Forum Fortgeschrittene Themen Shell und Programmieren Cronjob: Syntax Error: Unterminated quoted string Cronjob: Syntax Error: Unterminated quoted string « Vorherige, 1, Nächste » Status: Gelöst | Ubuntu-Version: Server 14.04 (Trusty Tahr) Antworten | theCed Anmeldungsdatum:21. Oktober 2011 Beiträge: 226 Zitieren 1. Juni 2014 23:12 Hi,ich kenne mich nicht wirklich mit Bash-Skripting aus und habe mir folgenden Cronjob für den Benutzer www-data zusammengebastelt, der meine Owncloud-Dateien auf eine andere Festplatte backupen soll (die 10 Minuten testweise, eigentlich @daily):1*/10 * * * * rsync -Aax /media/hdd2/clouddata/ /media/hdd1/backup/ownCloud/owncloud-dirbkp_$(date "+%Y-%m.%d") Wenn ich den Code in eine .sh-Datei schreibe und dann von www-data ausführen lasse, funktioniert alles. Im Cronjob bekomme ich nur eine Mail mit folgendem Inhalt:From: root@raspberrypi (Cron Daemon) To: www-data@raspberrypi Subject: Cron