I have a application executable, which runs with different parameters to produce different outputs. I want to give some parameters to this from the command line parameters of the script and others will be local to the script. Usage:
./dump-output.pl <version> <folder-name> <output-file>
my $version = $ARGV[0];
my $foldername = $ARGV[1];
my $outputfile = $ARGV[2];
my $mkdir_cmd = "mkdir -p ~/$foldername";
# There are 6 types of outputs, which can be created:
# 'a', 'b', 'c', 'd', 'e' or 'f'
my @outputtype = ('a', 'b', 'c', 'd', 'e', 'f');
my $mkdir_out = `$mkdir_cmd`;
for( $itr=0; itr<=5; itr++ ) {
$my_cmd = "./my_app -v $version -t $outputtype[itr] -f $outputfile > ~/$foldername/$outputtype.out"
$my_out = `$my_cmd`;
}
I am doing something inherently wrong with the above code, but have not been able to figure it out :-(