4

Is there a cleaner/DRYer way to export multiple functions than how I am doing it here, just repeating the export -f command over and over?

foo() {
  echo "foo"
}

bar() {
  echo "bar"
}

baz() {
  echo "baz"
}

export -f foo
export -f bar
export -f baz

1 Answer 1

8

export takes multiple arguments. You can do:

export -f foo bar baz
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.