Had another 48hr game jam this weekend...

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Sep 4 15:54:33 PDT 2013


On Wed, Sep 04, 2013 at 11:00:10PM +0200, Adam D. Ruppe wrote:
> I *hate* shell scripting. My rule is if it is more than three lines,
> do yourself a favor and use a real programming language. This is
> equally true on unix and windows.

I dunno, I find that windows batch files are so quirky, inconsistent,
and straitjacketed that they're nigh unusable for anything but the most
trivial uses. *nix shell scripts are a lot better.


> Well, actually, the limit with batch might be one line rather than
> three. But still, shells are for interactive entry. Doing any
> scripting on them is a filthy, time wasting, bug-prone hack.

I agree that bash scripting beyond simple uses is fragile and full of
unexpected holes (the primary culprit being the shell's over-eager
interpolation that sometimes interpolates multiple times per command,
and the lack of any usable built-in computational functions).  It's
generally pretty good for automating stuff you'd type by hand, but if
you need anything more complex like actual computations, data
manipulation, or control structures, I'd recommend Perl.

Or rather, D. :)


> (Especially on unix where you get idiocy like "command line too long"
> even trying to do simple tasks like deleting a bunch of files!

At least bash isn't so stupid as to impose arbitrary command-line length
limits. But yeah, on *nixes where there is such a limit (and where it's
unreasonably small), it's a royal pain.


> Or the output to a pipe gets truncated due to terminal width - I kid
> you not, FreeBSD did that to me some years ago when I had to use it on
> a server. Drove me nuts.)

Hmm. I haven't seen this one before on Linux. A BSD-specific issue
maybe?


T

-- 
GEEK = Gatherer of Extremely Enlightening Knowledge


More information about the Digitalmars-d mailing list