[Nix-dev] slightly off topic: bash/sh quoting/arguments

Michael Raskin 7c6f434c at mail.ru
Tue Apr 3 06:39:26 CEST 2012


>Ah, that's it then. it seems ${=foo} doesn't do the trick in zsh
>either though, but I don't care. It's not the target, I just tried it
>there.
>>
>> In general use a scripting language (ruby/python/perl/tcl/..) for
>> everything more complicated. bash starts to be a bottle neck very soon
>> (example is top-git)

With some experience, shell scripts up to a thousand lines are perfectly
usable.. But they can be just too slow

>Many tools (openvpn, dhcpcd, wicd) allow you to hook into certain
>events just by placing a small shell script somewhere. Of course you
>can invoke whatever you like from there, but loading ruby isn't
>exactly cheap :)
>So I wanted to stick to sh here.
>
>But I fully agree on your general point. Any useful utility you want
>to start should probably not be in bash. Problem always is that things
>start out in 4 lines of bash. But a week later it's 40 :)

About growing shell scripts - maybe "oh" (pseudo-shell in 
GoogleGoLanguage) is on to something with one-liners behaving as in 
shell... [gh:oh]

>I recently toyed around a bit with shelly [1], which is haskell's take
>on scripting. I must say it's pretty fun. If you compile to static
>binaries, there's an advantage over python/ruby/perl because it
>doesn't need a runtime env installed.
>
>Anyway, thanks for your extended answer.
>
>[1] http://hackage.haskell.org/package/shelly-0.3.1

[gh:oh] https://github.com/michaelmacinnis/oh





More information about the nix-dev mailing list