Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say; Script has function f1 defined. Script needs to call f1 to use. How do I do that? I searched online, it says I have to edit some PATH vairable, but does it mean global PATH or is there any PATH specifically used only in bash?

share|improve this question
up vote 7 down vote accepted



That will make the function available to be called within

The source command (also known as the . command) executes in's shell, so if you only want that function, you'll have to extract it into, and both and will have to source

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.