in reply to pass perl variable to shell script
#!/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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pass perl variable to shell script
by arthurs (Novice) on Aug 11, 2010 at 15:38 UTC | |
by morgon (Priest) on Aug 11, 2010 at 16:23 UTC | |
by arthurs (Novice) on Aug 11, 2010 at 17:01 UTC | |
by Anonymous Monk on Aug 11, 2010 at 17:05 UTC | |
by arthurs (Novice) on Aug 11, 2010 at 19:52 UTC | |
| |
by choroba (Cardinal) on Aug 11, 2010 at 17:20 UTC |