I'm trying to get my bash function to call another function that uses bash -c
. How do we make functions created earlier in the script persist between different bash sessions?
Current script:
#!/bin/bash
inner_function () {
echo "$1"
}
outer_function () {
bash -c "echo one; inner_function 'two'"
}
outer_function
Current output:
$ /tmp/test.sh
one
bash: inner_function: command not found
Desired output:
one
two
bash -c
is necessary within a script that already is executed by bash, if you don't mind me asking ?