#!/bin/sh output=$(perl -e 'print "hello world"'); echo $output;
If you have a more complex Perl-script then I would put it in it's own file and call it via $(perl script.pl) rathern then embedding it directly in the shell-script as a lot of metacharacters that Perl uses are also special to the shell and escaping all of them properly is a mess.
In reply to Re: pass perl variable to shell script
by morgon
in thread pass perl variable to shell script
by arthurs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |