in reply to Re: How to run bash file from perl
in thread How to run bash file from perl
my $afile='dir1/firstfile.txt'; my $bfile='dir2/secondfile.txt'; my $bash_command='learn.sh '.$afile.' '.$bfile.' |'; open(my $output,$bash_command) or die $!; while(my $line=<$output>){ print "$line"; }
my $afile='dir1/firstfile.txt'; my $bfile='dir2/secondfile.txt'; @args = ("learn.sh", $afile, $bfile); system(@args) == 0 or die "system @args failed: $?"
I tried three different ways as you all have suggested, but I couldn't make my script work. Please help me what is wrong in itmy $output=`learn.sh $afile $bfile`;
|
|---|