Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Running or not running

by perlinux (Deacon)
on May 12, 2004 at 14:18 UTC ( [id://352746]=note: print w/replies, xml ) Need Help??


in reply to Running or not running

If you're executing your batch from within a Perl script with system(), you can control your exit status. If system() returns 0 it's all ok...if this is not your situation, post other infos

Replies are listed 'Best First'.
Re: Re: Running or not running
by Anonymous Monk on May 12, 2004 at 15:14 UTC
    Yes, I will be executing batch files from within Perl, however these batch files or bundles are all silent software installation programs. Some of these batch file (we call them 'GO' scripts here) require some sort of user intervention, but some do not. I want to differentiate between the one that do require manual intervention to the ones that do not. For example :

    I might have a batch bundle that is called office2003.go. Inside this batch bundle I will have things like msword.go, excel.go, project.go....etc. when I click on this batch file, a progress bar appears on the screen and a message informing the tasks the go scripts is doing (in this case installing the whole office software suit).

    On the other hand, I might have another batch bundle, which is called something like Autoscore.go that installs the Autoscore software. However at some point during the installion, another dialog window might appear requesting further information or it will simple fail.

    This is basically what I am trying to achieve, is to distinguish between Go scripts that installs fully without user intervention and other go scripts that either fail out right or will never install untill maual intervension is provided.

    If I do this manually it would probably take me months to finish of because I have thousands of these applications or batch bundles

    I suppose a good place for me to start would be if I can write a script that runs a batch file and informs whether the batch execution has completed successfully or not.

    Mind you some batch file could take few seconds to install and other batch bundles could take hours. so I suppose I have tp rogram some sort of timing threshold knowing that the longest batch bundle would not take more that 6 hours to install.

    Thanks
      If you're starting the .go files from within your Perl script, you should be able to start them up with system, and when that function returns the program is complete.
        Ok this is what I did
        #! c:\perl\bin $|++; use strict; use vars qw /%data/; $data{apps_list} = shift @ARGV; system (cls); print "\n\nPath to apps list => ". $data{apps_list}."\n"; open (LST, "$data{apps_list}") || die "$! : File was not found\n"; chomp (@{$data{Go_scripts}} = <LST>); for my $item (@{$data{Go_scripts}}) { print "\n$item\n"; system ($item); if (system() ==0) # this is incorrect { print "\n Done\n"; } else { print "Failed\n"; } }
        Obviously it doesn't work because of the "if (system() ==0)" which is not correct, but the correct way of this is what I am trying to achieve!

        Any Thoughts?

        TIA

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://352746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-29 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found