Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15761

How to pass bash variable from one to another script

$
0
0

I got 2 bash scripts:

script1.sh

#!/bin/bashTAG=`git rev-parse --short HEAD` #pass hash commit numbersdocker build -t $TAG .

script2.sh

#!/bin/bashcat $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. These scripts will be run in pipelines e.g. bamboo/jenkins so I want that second script knows value of variable from the first one. export command in this case is not useful


Viewing all articles
Browse latest Browse all 15761

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>