I have the next shell script which I have named run.sh
#!/usr/bin/perl -w
#!/bin/sh
BROL="/sc01a4/users/user/brol"
PID=$$
while read line
do
echo "$line" >> $BROL/rolak/1_EUSLEM_MATE/Sarrera_Testua_$PID.xml
done < "${1:-/proc/${$}/fd/0}"
perl $BROL/rolak/NAGUSIA.pl $BROL $PID
This script runs NAGUSIA.pl with two arguments, the path BROL and the process id, variable PID.
#!/usr/bin/perl -w
use strict;
use warnings;
my $direktorioa = "$ARGV[0]";
my $prozesua = "$ARGV[1]";
use lib "$direktorioa/rolak/lib";
use SRL::NAGUSIA qw(Egokitu_Sarrera Predikatu_Identifikazioa Predikatu_Desanbiguazioa Argumentuak_Identifikatu Argumentuak_Sailkatu Sortu_Irteera);
Egokitu_Sarrera($prozesua, $direktorioa);
Predikatu_Identifikazioa($prozesua, $direktorioa);
Predikatu_Desanbiguazioa($prozesua, $direktorioa);
Argumentuak_Identifikatu($prozesua, $direktorioa);
Argumentuak_Sailkatu($prozesua, $direktorioa);
Sortu_Irteera($prozesua, $direktorioa);
The Perl script is supposed two receive these two arguments but the command line gives the next error:
Use of uninitialized value $direktorioa in concatenation (.) or string at /sc01a4/users/user/brol/rolak/NAGUSIA.pl line 9.
I use the next command in order to run the shell script:
cat brol/proba_fitxategiak/proba4.txt | sh brol/EHU-eustagger/run.sh | sh brol/rolak/run.sh
I am using Linux, not Windows. Why the Perl script does not receive the arguments passed by the shell script?
print "direktorioa : $direktorioa \n";to verify that.run.shwon't help you to find errors.run.sh. That is a result of having at least two programs calledrun.shand possibly more.