in reply to Re: Script which creates 2nd script and runs it
in thread Script which creates 2nd script and runs it

Look at the bottom of the script. I AM using  system. What I'm saying, is as written, it doesn't work. The file script-$date is written, but that's it!

Replies are listed 'Best First'.
Re: Re: Re: Script which creates 2nd script and runs it
by chipmunk (Parson) on Feb 01, 2001 at 01:55 UTC
    You're using system to execute a shell script which then executes other commands. My suggestion is skipping the shell script altogether, and using system to execute those commands directly from Perl.

    For example:

    foreach $key (keys %hash) { my $cmd = "$program $key $matrix "; $cmd .= "$path/CISCO_$_.clean " for @{$hash{$key}}; system($cmd) == 0 # system returns 0 on success or die "system '$cmd' failed: $?"; }