Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Shell scripts and perl

by andreas1234567 (Vicar)
on Sep 10, 2007 at 14:13 UTC ( #638082=note: print w/replies, xml ) Need Help??


in reply to Shell scripts and perl

I prefer shell scripts to Perl for tasks that:
  • Are small and simple.
  • Are unlikely to fail. (I find pipeline error handling difficult: grep '\.pl$' foo | sort | uniq | xargs find. Now exactly where is the error? )
  • I find hard write in Perl (e.g. find /usr/ -maxdepth 2).
Otherwise I find myself writing Perl.
--
Andreas

Replies are listed 'Best First'.
Re^2: Shell scripts and perl
by Fletch (Bishop) on Sep 10, 2007 at 14:20 UTC

    (Drifting slightly offtopic, but . . . :)

    Are unlikely to fail. (I find pipeline error handling difficult: grep '\.pl$' foo | sort | uniq | xargs find. Now exactly where is the error? )

    zsh provides a pipestatus variable which is an array of the exit statusen from each component of the last pipeline. Granted that doesn't solve problems where one part of the pipe is generating bad data, but it does let you handle a few more kinds of problems.

    Update: Oop, quite right. Recent bash have stolen :) this zsh functionality (along with programmable completions and other Z goodies :).

      bash provides this as well.
      Ted
      --
      "That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
        --Ralph Waldo Emerson

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2022-08-17 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?