I recently had occasion to refactor a bunch of bash scripts, and one of the problems was that certain loop constructs were cropping up a lot. A quick search didn't turn up a way to do higher order functions in bash, so I (re)invented one:
higher_order() {
# some code
eval "$1"
# some more code
}The eval evaluates the code passed as a
(
Read more... )