I am writing my own functions that are sources from my .bashrc. I fail to understand whether I should use export -f curisac after defining the function curisac.

1 Answer 1

  • You do not need to export the function to use it in your open interactive shell.
  • You do not need to export it if your interactive shells load .bashrc and the functions are defined there.
  • But you do need to export the functions to have them available in shell processes that are started from your running interactive shell (without defining them in a file loaded at the start like .bashrc) by executing sh for example.

In short: no need if your shells load .bashrc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .