Afficher un message
Vieux 30/05/2007, 11h52   #3
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Variable in embedded perl script

In article <1180507741.259940.164980@q69g2000hsb.googlegroups .com>,
Jose Luis <jose.luis.fdez.diaz@gmail.com> wrote:

> Hi,
>
> In the ksh script below:
>
> #!/usr/bin/ksh
>
> perl <<-EOF
> my \$var="hello world\n";
> print "\$var";
> EOF
>
>
>
> I need to put the "\" character before all vars in the perl script.
> How can I avoid it?


perl <<-'EOF'
my $var="hello world\n";
print "$var";
EOF

Putting single quotes around the here-document delimiter tells the shell
not to perform any expansion on the contents of the here-document.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
 
Page generated in 0,04718 seconds with 9 queries