I have some functions in ~/.bashrc: function find-grep { find . -name "$1" -type f -exec grep -FHn "$2" {} \; } export -f find-grep But when I use different terminals and run different programs, I get these error messages - all at once: sh: error importing function definition for `BASH_FUNC_find-grep' /bin/bash: error importing function definition for `BASH_FUNC_find-grep' /bin/sh: error importing function definition for `BASH_FUNC_find-grep' Bash version: 4.3.25(1)-release (x86_64-redhat-linux-gnu)
Do you need this function definitions only in interactive shells? Then you can simply drop the “export -f” command. The definitions will still be available because they are loaded from ~/.bashrc each time an interactive shell starts. The culprit here is the “-” character in the function name. The original upstream fix for CVE-2014-6271 added an additional requirement that imported function names follow the syntactic rules of shell variables, and “-” characters are not allowed in variable names, either. This restriction was carried forward to the current patches in Fedora. I think “export -f” should fail with an error here, to make it more obvious what's going on.
Not fixed, but at least the problem is explained. Thanks.