I am new to bash shell scripting and I need guidance to write a bash script which will execute other multiple bash scripts or php scripts. If you can help me on this I will be very thankful.
1 Answer
Most basic example vi test.sh
with content:
#!/bin/bash
./test2.sh
vi test2.sh
with content:
#!/bin/bash
echo "hi there"
test.sh
when executed will execute test2.sh
(and expects it in the same path as test.sh
).
-
-
Why use
sh
here? IMHO it would be better to ensure thattest2.sh
is executable and let its shebang take care of what interpreter to use Jan 15, 2020 at 15:07 -
echo
. Just make sure the called scripts are either in the current path or you call them by full name _/path/to/script.sh.