Skip to main content
note about `sh` linked to `bash`
Source Link
Bodo
  • 6.4k
  • 18
  • 30

You should not export the functions. Instead I suggest to source .bash_aliases for all bash instances that need it. (I guess you need the functions in interactive bash shells only.)

A similar problem is mentioned here: /bin/sh: error importing function definition for `some-function', where the accepted answer proposes to rename the functions.

You see the errors even if /bin/sh is linked to bash on your system, because when bash is called as sh, it tries to behave like sh and to comply with POSIX, see https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html#Invoked-with-name-sh

You should not export the functions. Instead I suggest to source .bash_aliases for all bash instances that need it. (I guess you need the functions in interactive bash shells only.)

A similar problem is mentioned here: /bin/sh: error importing function definition for `some-function', where the accepted answer proposes to rename the functions.

You should not export the functions. Instead I suggest to source .bash_aliases for all bash instances that need it. (I guess you need the functions in interactive bash shells only.)

A similar problem is mentioned here: /bin/sh: error importing function definition for `some-function', where the accepted answer proposes to rename the functions.

You see the errors even if /bin/sh is linked to bash on your system, because when bash is called as sh, it tries to behave like sh and to comply with POSIX, see https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html#Invoked-with-name-sh

added 61 characters in body
Source Link
Bodo
  • 6.4k
  • 18
  • 30

You should not export the functions. Instead I suggest to source .bash_aliases for all bash instances that need it. (I guess you need the functions in interactive bash shells only.)

A similar problem is mentioned here: /bin/sh: error importing function definition for `some-function', where the accepted answer proposes to rename the functions.

You should not export the functions. Instead I suggest to source .bash_aliases for all bash instances that need it. (I guess you need the functions in interactive bash shells only.)

A similar problem is mentioned here: /bin/sh: error importing function definition for `some-function'

You should not export the functions. Instead I suggest to source .bash_aliases for all bash instances that need it. (I guess you need the functions in interactive bash shells only.)

A similar problem is mentioned here: /bin/sh: error importing function definition for `some-function', where the accepted answer proposes to rename the functions.

Source Link
Bodo
  • 6.4k
  • 18
  • 30

You should not export the functions. Instead I suggest to source .bash_aliases for all bash instances that need it. (I guess you need the functions in interactive bash shells only.)

A similar problem is mentioned here: /bin/sh: error importing function definition for `some-function'