Change file2.sh to:
#!/bin/bash
echo "from file2: ${BASH_SOURCE[0]}"
Note that BASH_SOURCE is an array variable. See the Bash man pages for more information.
Change file2.sh to:
#!/bin/bash
echo "from file2: ${BASH_SOURCE[0]}"
Note that BASH_SOURCE is an array variable. See the Bash man pages for more information.