in reply to Re: perl script inside a shell script
in thread perl script inside a shell script
Because << is a redirection to STDIN, in order to add $i to the command line I also had to add - so that perl would know to read the script from STDIN.#!/bin/sh echo This is bash i=12 echo $i perl - $i <<'__HERE__' my $i = shift; print "This is perl\n"; print ++$i . "\n"; __HERE__ echo This is bash again echo $i
|
|---|