$ function blargh () {
> echo $1
> }
$ export -f blargh
$ bash
$ blargh hi there
hi
$ exit
$ bash -c "blargh hi there"
hi
export -f - non-obvious bit.
$ help export
export: export [-fn] [name[=value] ...] or export -p
Set export attribute for shell variables.
Marks each NAME for automatic export to the environment of subsequently
executed commands. If VALUE is supplied, assign VALUE before exporting.
Options:
-f refer to shell functions
...
source
share