builtin-option
Bash export -f
Marks a function for export to compatible child Bash processes; removing export does not remove its current definition. Not a portable module mechanism.
Formal Syntax & Structure
bash syntaxbash
export -f name; export -n -f nameReturn Value
exit status
Marks a function for export to compatible child Bash processes; removing export does not remove its current definition. Not a portable module mechanism.
Working Example
Example Snippetbash
hello() { printf '%s\n' child; }export -f hellobash --noprofile --norc -c 'hello'export -n -f hellobash --noprofile --norc -c 'if ! declare -F hello >/dev/null; then printf "%s\n" absent; fi'