Not Perl, but - use command substitution.
#!/bin/sh str="Hello" out=$(perl - $str << 'EOF' $str2 = shift; $str3 = "world"; print "$str2 $str3\n"; EOF ) str3=$(echo $out|cut -d' ' -f2) echo $out echo "In the shell, \$str3 is '$str3'"
In reply to Re: pass perl variable to shell script
by oko1
in thread pass perl variable to shell script
by arthurs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |