Monthly Archives: March 2018

Just for fun: map as ‘higher-order function’ in bash

Originally posted on On The Balcony:
Defined recursively, of course: map () { if [ $# -le 1 ]; then return else local f=$1 local x=$2 shift 2 local xs=$@ $f $x map “$f” $xs fi } I’m not going…

Posted in Uncategorized | Leave a comment