heredoc

I am unable to fix an issue concerning an HEREDOC syntax error

余生颓废 提交于 2019-12-13 06:50:28
问题 This is the link in order to avoid to be marked as duplicate Issue with heredoc and PHP I haven't been able to solve the issue following the solutions provided by the developers. Within this snippet of code there must be certainly a syntax error but I can't find where it is, as a matter of fact the below Heredoc statement does not work and prevents the whole code from working, furthermore if I try to run the code on my web server I have a 500 server error. I have modified my question

Android (5.0.1) Chrome is deleting javascript whitespace and comments, is there a way to stop this?

a 夏天 提交于 2019-12-13 04:47:49
问题 In addition to making debugging almost impossible, this new behavior is breaking my website where I use the heredoc javascript technique, (Javascript heredoc) which depends on using comments. I'm not sure if I inadvertably turned this on, and this is a rare occurrence, or if this is a new Android feature. I'm concerned because I use the heredoc javascript technique on a number of different sites, and this behavior will break these sites. Has anyone else experienced this? Is there a workaround

in bash, heredoc inside function returns syntax error

谁说我不能喝 提交于 2019-12-12 15:46:36
问题 I have the following function: #!/bin/bash get_instance{ dbname=$(sqlplus -s / as sysdba<<EOF set pages 0 set feedback off select name from v\$database; exit; EOF) echo $dbname } get_instance It seems to work. In the middle of the error message, I get my dbname , but still returns a syntax error. oracle@testdb01:db01:/home/oracle/ > ./test.sh ./test.sh: line 3: get_instance{: command not found DB01 ./test.sh: line 11: syntax error near unexpected token `}' ./test.sh: line 11: `}' If I remove

Clean way to build long strings in Ruby

时光怂恿深爱的人放手 提交于 2019-12-12 10:59:21
问题 When writing Ruby (client scripts) I see three ways to build longer strings, including line-endings, all of which "smell" kind of ugly to me. Are there any cleaner and nicer ways? The variable-incrementing. if render_quote? quote = "Now that there is the Tec-9, a crappy spray gun from South Miami." quote += "This gun is advertised as the most popular gun in American crime. Do you believe that shit?" quote += "It actually says that in the little book that comes with it: the most popular gun in

Parse error: syntax error, unexpected T_SL PHP heredoc

╄→гoц情女王★ 提交于 2019-12-12 10:43:38
问题 I keep getting the following error: Parse error: syntax error, unexpected T_SL in /home/a4999406/public_html/willingLog.html on line 70 on the following code (first line is line 70): echo <<<END <form action = "willingLog.html" method="post"><pre> First <input type="text" name="first" /> Last <input type="text" name="last" /> Email <input type="text" name="email" /> Username <input type="text" name="user_name" /> <input type="submit" value="AD RECORD" /> </pre></form> END; heredoc just doesn

Why do these Heredoc and Nowdoc cause errors?

限于喜欢 提交于 2019-12-12 07:14:25
问题 I've already found some solutions, but can't know what happened... Example 1: <?php echo <<< EOD test EOD; Example 2: <?php echo <<< 'EOD' test EOD; Output 1,2: PHP Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or heredoc end (T_END_HEREDOC) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) Example 3: <?php echo <<< EOD test EOD; ?> Example 4: <?php echo <<< 'EOD' test EOD; ?> Example 5: <?php echo <<< EOD test EOD; 'dummy'; Example 6: <?php echo <<<

Multiline bash using sed to remove leading whitespace: quotes erroneously preserved in command argument

早过忘川 提交于 2019-12-12 06:36:42
问题 I am running this piece of code: annotate-output $((sed -E 's/^[ ]+//;' <<____COMMAND sshfs foo_user@fooserver.com:/sftp_folder /var/sshfs.sandbox/server.com -o user=foo_user ,reconnect ,ServerAliveInterval=15 ,ServerAliveCountMax=3 ____COMMAND ) | sed -E -e ':a;N;$!ba;s/\n//g') It's my (perhaps clumsy) attempt at having a generic way of achieving multiline in bash. Note that there is a trailing space whenever it is needed by the command I'm trying to split into multple lines: sshfs foo_user

PHP Why Can't EOM contain PHP functions? [duplicate]

让人想犯罪 __ 提交于 2019-12-12 03:48:51
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Calling PHP functions within HEREDOC strings I am using Swiftmailer PHP to create an order complete page. When the customer lands on this page, I use an include to a PHP file. This page file has SwiftMailer EOM HTML that gets sent to the customer. However I have the HTML parts in chunks, so the header is via a function called header and order totals are the same too. I want to be able to include EOM functions

ssh + here-document syntax with Python

痞子三分冷 提交于 2019-12-12 02:56:31
问题 I'm trying to run a set of commands through ssh from a Python script. I came upon the here-document concept and thought: cool, let me implement something like this: command = ( ( 'ssh user@host /usr/bin/bash <<EOF\n' + 'cd %s \n' + 'qsub %s\n' + 'EOF' ) % (test_dir, jobfile) ) try: p = subprocess.Popen( command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) except : print ('from subprocess.Popen( %s )' % command.split() ) raise Exception #endtry Unfortunately, here is what I get:

How should I be using variables in bash shell sending heredoc section over ssh?

廉价感情. 提交于 2019-12-12 01:24:27
问题 I have a bash script that I am trying to reconfigure to remove some hardcoded values. The script sets a variable with the content from a heredoc section and that variable is passed through to the remote server via ssh. #!/bin/bash FILEREF=${1} CMDS=$(cat <<HDOC echo $FILEREF COUNT=$(timeout 10s egrep -c -m 1 'INFO: Destroying ProtocolHandler \["http-bio-8080"\]' <(tail -n0 -f ~/tomcat/logs/catalina.out)) # removed a load of other stuff for brevity HDOC ) #/usr/bin/ssh.exe -t -t -o