I got 2 bash scripts:
script1.sh
#!/bin/bash
TAG=`git rev-parse --short HEAD` #pass hash commit numbers
docker build -t $TAG .
script2.sh
#!/bin/bash
cat $TAG
I want to run script1.sh and then script2.sh.
How to pass variable TAG that script2 knows the value? It should work automatically I mean only run a command.