Is it possible to create something analogous to an anonymous function whose value can be assigned to an array element and later called? I can\'t seem to find a way to do thi
The common technique is to assign function definitions conditionally:
#!/bin/sh case $1 in a) foo() { echo case a; };; b) foo() { echo case b; };; *) foo() { echo default; } ;; esac foo