Home

Closures and Function Currying... in BASH?

I don't think anyone will disagree with me when I say that GNU BASH is not a functional programming language. Some people would probably even argue that bash is not a programming language at all. Whatever opinion you may have, there is no denying that bash is a damn handy too to have in your belt. Today I figured I'd share some functional concepts that have been helpful to me when writing scripts in BASH, which is my favorite scripting language for workflow automation.

Using functions for clarity

[[ LINK TO YOUTUBE VIDEO FUNCTIONAL TAO OF BASH ]]

Using pipes as map/reduce

Using recursion to grow state

Bonus: A demonstration of a madman, closures and currying in bash