Re:Shell programming with bash: by example, by counter-example
by ufo on Monday January 13, 2014 @02:22PM
(#7052690)
What to use instead of bash though? I hate having to worry about all the little quirks in bash but most other languages make simple things like input redirection and piping commands awfully verbose.
[ Parent
| on HN ]
Re:Shell programming with bash: by example, by counter-example
by jevinskie on Monday January 13, 2014 @10:30PM
(#7055196)
Check out IPC::Run for Perl. [0] Perl was already pretty nice with it's backticks but IPC::Run takes it another step further and allows you to do all sorts of redirection/piping/etc with the single 'run' subroutine. If you want an 'expect' sort of use, you can do that too.
[0]: http://search.cpan.org/~toddr/IPC-Run-0.92/lib/IPC/Run.pm
Re:Shell programming with bash: by example, by counter-example
by ufo on Tuesday January 14, 2014 @06:57AM
(#7056517)
Really liking it so far. Thanks for the suggestion.
Re:Shell programming with bash: by example, by counter-example
by chongli on Monday January 13, 2014 @10:05PM
(#7055103)
Haskell! Seriously, people do shell scripting in Haskell. There's actually a pretty nice library designed for it called Shelly:
https://github.com/yesodweb/Shelly.hs/blob/master/README.md#...
Re:Shell programming with bash: by example, by counter-example
by dllthomas on Monday January 13, 2014 @10:09PM
(#7055126)
Shelly is great! Still, there is some minimum complexity before something is better done in it, and porting a small bash script that has grown from a tiny bash script is pretty trivial.