[chef] Re: reg bash in cat


Chronological Thread 
  • From: Cameron Cope < >
  • To: Indra k < >
  • Cc:
  • Subject: [chef] Re: reg bash in cat
  • Date: Fri, 1 Aug 2014 19:49:05 -0400

You can't have any extra characters on the line with the ending delimiter.

http://stackoverflow.com/a/2500451

-Cam

On Aug 1, 2014 3:19 AM, "Indra k" < "> > wrote:
Hi,

 I ve been executing this code :
ssh.exec("cat > /home/bitscompress.sh <<'EOF'
                      
                       mv /var/www/magentodb.sql /var/www/Magentobits_V2
                       mv /var/www/wordpressdb.sql /var/www/Magentobits_V2
                       cp -R /var/www/wordpress /var/www/Magentobits_V2
                       cd /var/www
                       tar cvzf Magentobits_V2.tar.gz /var/www/Magentobits_V2 
EOF && /home/bitcompress.sh")

in ruby block resource.but it creates a file with eof loke this:
/home/bitscompress.sh

        mv /var/www/magentodb.sql /var/www/Magentobits_V2
                       mv /var/www/wordpressdb.sql /var/www/Magentobits_V2
                       cp -R /var/www/wordpress /var/www/Magentobits_V2
                       cd /var/www
                       tar cvzf Magentobits_V2.tar.gz /var/www/Magentobits_V2 
EOF && /home/bitcompress.sh


and showing the warning:
 Recipe: trans::default
172.16.1.121
172.16.1.121   * ruby_block[Transfer bits] action run
172.16.1.121 bash: line 7: warning: here-document at line 0 delimited by end-of-file (wanted `EOF')

Anyidea  guys?


Thanks,
Indra





Archive powered by MHonArc 2.6.16.

§