I am writing some bash scripts that I want to deliver and mantain with a deb package. As I need to list the dependencies of the package, I would like to find all executables that the scripts are calling and find which packages do they belong.
Is it possible to list all executables called by a bash script?
EDIT
To better clarify: say that my script is
#!/bin/sh
echo "hello"
cat file.txt | grep -v "STRING"
if [ -d $SOMEDIR ]; then
./something.sh
else
./something_else.sh
fi
I would like to analyze the content of such script and the output should be:
echo
cat
grep
./something.sh
./something_else.sh
(regardless of any other possible executable called by the other two *.sh scripts)