If your shell script is just a driver for a bunch of other programs which run pretty much in order with fairly static sets of command-line options, then it can be fairly long without being an issue at all.
Right; many scripts start life exactly like that. For example, "check out some files, run make, check condition X and scp files to server Y, update config file Z...". Many lines of the script are simply using external programs like cvs, scp, mysqldump, whatever. If it's just a page full of lines like that, I wouldn't want a long sequence of system calls in a Perl script.
But as time goes by, users want more and more little bits added here and there, and even though it's still primarily a "driver for a bunch of other programs", now it's starting to do a little more error checking, more branching, and repeated bits are put into functions.
This is primarily the case I'm asking about here. When it's a sort of gray area, and you know you could just dig in and update the shell script, but you also know that it really won't fix the more inherent problems that a rewrite in Perl would. Also you want less work for yourself the next time you get a feature request for said script.
-
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 How to display code and escape characters
are good places to start.
|