Are you limited to just editing the shell script, or can you change the perl script in question as well?

At the point when you start the shell script, do you already know what numeric value you want to supply to the final perl script?

Is there a compelling reason to use a shell script to invoke all those perl scripts, as opposed to using a perl script to run them all?

If you can modify the final-step perl script in the set, and if you know the value you want before you start the shell script, make that last perl script look for a command-line arg to get its numeric value, and supply it up front when running the shell script.

Better yet, use Perl instead of shell to run everything, and in the case of the last script, start it like this:

open(LAST, "|last_script.pl"); print LAST "$numeric_param\n"; close LAST;
This way, at whatever point is suitable before running this last step, you can assign a suitable value to $numeric_param, using whatever perl input method suits you (hard coded, command-line arg, user input on stdin, reading results of some previous step in the chain, checking localtime, ... or any combination thereof), and you don't have to edit that particular perl script, either.

In reply to Re: shell scripts + user response by graff
in thread shell scripts + user response 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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.