I want to plant multiple Bash scripts inside my "main" tcl program - so no external .sh scripts - I want it all in one place. I already found out how to plant one script into tcl:
set printScript { echo $HOME }
proc printProc {printScript} {
puts [exec /bin/bash << $printScript]
}
printProc $printScript
My question is now: How can I use this concept to implement scripts that call other scripts without hardcoding the called script into the calling script? Let's say I have something like this:
script1.sh
script2="$PWD/script2.sh"
#do some stuff
if [something]
then
$script2
fi
#do some more stuff
Can the above mentioned concept be used to solve my problem? How can this be done?
bash. @n.m. has the right idea. - l0b0function.shand use the functions of that script by mentioning it in your other scripts. ..../function.sh- Aman