Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
It looks like both "Script1.pl" and "Script2.pl" take the same command line args, so how about a "Script.pl" (not numbered), instead of a shell script, in order to pick the right one:
#!/usr/bin/perl my $script = ( $^O =~ /linux|solaris/ ) ? "Script1.pl" : "Script2.pl"; exec $script, @ARGV;
That assumes that you've done "chmod +x" on Script1.pl and Script2.pl, and they are in your shell's PATH (e.g., if they are in your current working directory, then your PATH should include ".").

It might be even better if the differences between Script1 and Script2 could be merged into a single perl script, with appropriate logic to do things differently depending on the value of $^O. Then you don't need a separate "wrapper" script at all.


In reply to Re: execute perl script frm shell script by graff
in thread execute perl script frm shell script by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2022-09-28 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (124 votes). Check out past polls.

    Notices?