I have three bash scripts. w.txt, t.txt and d.txt.
w.txt:
#!/bin/bash
wtimes=( 8:20 9:30 10:11 )
wtimef=( 10:10 11:20 13:30 )
echo $wtimes >> d.txt
t.txt
#!/bin/bash
. ./w.txt
echo "${wtimes[1]}"
echo "${wtimef[1]}"
I am trying to run t.txt so I can work with the array variables $wtimes and $wtimef in t.txt without running echo $wtimes >> d.txt. This is very simplyfied and there are actually many more commands in w.txt that I do not want executed from within t.txt. How can I be selective here? Can someone please help?