Advertisement

04.22.2008 at 07:34AM PDT, ID: 23343079
[x]
Attachment Details

shell script within Perl script

Asked by saibsk in Perl Programming Language

foreach (@clientNames){
                # $_ represent the next client name;
                # loop through list
                print "\nProcessing client [$_]:\t";
                @args1 = ("ksh","/export/home/user/Check.ksh","201","$_");
                system(@args1) == 0
                        or die "system @args1 failed: $?";
                #$_ =~ s/ //g;
                print "Client [$_] has associated database client\n" if exists $clientDBHash{$_}
                        or print "Client [$_] does NOT have an associated database client\n";

                foreach $i ( 0 .. $#{ $clientDBHash{$_} } ){
                       
                        print "\n\nPlease enter the @envs[$envNum] Sybase common database Username:\t";
                        my $sybaseUser = 'user';
                        chomp $sybaseUser;
                        print "\nPlease enter the @envs[$envNum] Sybase common database Password:\t";
                        my $sybasePW = $config{'user'};
                        chomp $sybasePW;
                        my $username = "-U$sybaseUser";
                        my $password = "-P$sybasePW";
                        my $server =   "-Sclient062";
                        my $verbose =  "-v1";
                        my $script =   "-i$_" . "_fund.sql";
                        print "NAME: [$script]\n";
                        my $dbLoginString = $username . " " . $password . " " . $server . " " . $script;
                        print "\n\tDEBUG (dbLoginString): [$dbLoginString]\n";
                        #my @args = ("isql",$username,$password,$server,$script);
                        @args = ("isql","$username","$password","$server","$script");
}
}

The problem with my code above is at the step where I execute the ksh it doesnt return to the loop after the execution of the ksh shell script. How can I return to the loop after the execution of the ksh scriptStart Free Trial
[+][-]04.22.2008 at 08:14AM PDT, ID: 21411930

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 10:40AM PDT, ID: 21413553

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 12:06PM PDT, ID: 21414346

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 01:13PM PDT, ID: 21415093

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 01:21PM PDT, ID: 21415189

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 07:18AM PDT, ID: 21420935

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 07:40AM PDT, ID: 21421173

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: FishMonger
Participating Experts: 4
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628