tannx has asked for the wisdom of the Perl Monks concerning the following question:
why does this part not under linux work?#!/usr/bin/perl -w use POSIX qw(strftime); $in_dir = '/home/data'; $out_dir = '/var/www/html/rwa_test/input'; $zip_dir = '/home/data/archive'; $kpva = strftime("%Y%m%d", localtime); $wait = 30; while (0 < 1) { system ("ls -htr $in_dir/*.P.M > $in_dir/failid.rwa "); sleep 30; open(TF, "$in_dir/failid.rwa"); while (<TF>) { chomp; print $_,"\n"; s|$in_dir/||; print $_,"\n"; $ifn = $_; system("gzip -f <$in_dir/$ifn >$zip_dir/$ifn.$kpva.gz" +); open(IF,"$in_dir/$ifn"); open(OF,">$out_dir/$ifn.$kpva"); while(<IF>) { chomp; $line = $_; last if $line =~ /^-{19}/; $line =~ s/,/./g; $line =~ s/\t/;/g; print OF $line,"\n"; } close (IF); close (OF); $cmd = "dbisqlc -c ".'"uid=.....;pwd=.....;eng=......;dbn=...... "'." +-q call ......Fun_LoadAllFiles( '"."$out_dir/$ifn.$kpva', '$ifn.$kpva +')"; print $cmd,"\n"; system (@cmd); system("mv -f $in_dir/$ifn $in_dir/$ifn.done"); } close(TF); sleep $wait; }
added print $cmd and it shows as it should <code> dbisqlc -c "uid=****;pwd=*****;eng=*****;dbn=***** " -q call ****.Fun_LoadAllFiles( '/var/www/html/rwa_test/input/file_name', 'file_name')$cmd = "dbisqlc -c ".'"uid=****;pwd=****;eng=****;dbn=**** "'." -q cal +l ****.Fun_LoadAllFiles( '"."$out_dir/$ifn.$kpva', '$ifn.$kpva')";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unable execute $cmd
by BrowserUk (Patriarch) on Oct 20, 2008 at 08:14 UTC | |
|
Re: unable execute $cmd
by jwkrahn (Abbot) on Oct 20, 2008 at 11:16 UTC | |
|
Re: unable execute $cmd
by tannx (Acolyte) on Oct 20, 2008 at 09:15 UTC | |
by JavaFan (Canon) on Oct 20, 2008 at 09:32 UTC | |
by Anonymous Monk on Oct 20, 2008 at 09:58 UTC |