[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /usr/bin/[ what is it?



Ron Johnson wrote:
> Problems with shell expansion:
> 1. If your glob expands very large, the command buffer will
>    overflow.
> 2. You can only pass wild-carded filenames.
> 3. You've got to escape re characters

4. You have to escape pretty much any variable you want to pass unexpanded to
a command... except when you don't want to.

    Globbing is the Alpha and Omega on why I break out Python or (ewwww) Perl
when doing any script large or small.  I know that when I pass a variable
there is a reasonable assurance it isn't going to magically transform or screw
up the rest of the script.  Well, at least in Python.  Perl's a half-step
better... barely.  :D

    1 liners which involve no variable passing and minimal data manipulation,
shell's fine.  2+ lines, variable passing, data manipulation, fuggetabootit!

-- 
         Steve C. Lamb         | But who decides what they dream?
       PGP Key: 8B6E99C5       |   And dream I do...
-------------------------------+---------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: