The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-17-2008
pinkgladiator pinkgladiator is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 17
Passing a file handler and an array from Perl to Shell Script

Hi there,

I am trying to call a shell script from a Perl script. here is the code:
@args = ("sh", "someshellprg.sh", "a file handler", "an array");
system(@args) == 0
or die "system @args failed: $?";

in the shell program, I examine if the arguments exits using:

if [ $# -ne 2 ]
then echo "missing input"
exit 1
fi

the script returns "missing input", any ideas? Thanks in advance.