The biggest point, which Abigail already made, is that there's hardly such a thing as a pure shell script. You need other Unix tools to do fancy stuff.

That can be clumsy. find trickery often leads to spawning hundreds of processes. sed is fun since it's small and light and can get things done quick&dirty. sort is a hackjob more often than not. awk is missing the ward to complete the name and is clumsy enough that I've never really gotten to use it - I find myself moving the script to Perl sooner than I get a chance to play with awk.

I enjoy working on the shell immensely (after 10 years of COMMAND.COM, who wouldn't?), but when scripting it depends on the complexity. The point when I abandon bash and move to Perl is when I need more than 3 or 4 calls to external tools to get the job done. Sometimes that limit is as tight as it seems, sometimes - because bash is quite powerful - it's enough. More demanding stuff is likely done better in Perl. (I saw a suite of CGI scripts for system administration once - written in bash. A very surreal experience.) Most of my scripts start out as some semicomplex command I find myself using repeatedly. When I get tired of typing, I dump the sequence into a shell script. As time goes by I find myself tweaking the script to be more generically usable. I often hit a brick wall with the shell at that point and things get really clunky. Transition to Perl is then just a logical step.

Makeshifts last the longest.


In reply to Re: Perl vs. Shell Script by Aristotle
in thread Perl vs. Shell Script by ellem

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.