I have many BASH scripts called in sequence, e.g., script1.sh
contains:
#!/bin/bash
bash script2.sh
bash script3.sh
bash script4.sh
script2.sh
contains:
#!/bin/bash
file_a="1.txt"
cp $file_a /tmp/$file_a.tmp
script3.sh
contains:
#!/bin/bash
wc -l /tmp/$file_a.tmp
script4.sh
contains:
#!/bin/bash
cat /tmp/2.txt $file_a.tmp > file3.txt
Each file requires access to a small collection of variables. How can I pass the variables from one script onto the next?