I can to define function in bash and use it:
foo() { echo $1; }
foo test
But if I want to collect my functions in one bash script all its unavailable:
init.bash
#!/bin/bash
foo() { echo $1; }
export -f foo # This not helps
Using:
./init.bash && foo test # error here
Is there any way to export script's functions to parent scope?
Without writing to .bashrc, it's too global
Same as .bashrc but for current bash instance only...