i want make the below snippet a function ,but when im exporting values of file mx.env and if i pass them to a function it is not picking it up it printing empty value .
for example:
getjar {
echo $1
echo "$1"
curl https://my.com:$1.jar
}
getjar "javaprocess1"
it prints empty value .i tried to use source instead of export still i get same result.
more detailed script content
echo "Export Env Variables "
export $(cat ../env/mx.env | sed 's/#.*//g' | xargs)
curl -L -X GET
https://company.com/repository/{javaprocess_TAG}.jar --output javaprocess.jar
nohup java -jar javaprocess.jar
#######################################################
my env file
cat ../env/mx.env
javaprocess1_TAG=7.0.0.0.9
javaprocess2_TAG=7.0.0.0.8
javaprocess3_TAG='7.0.0.0.5'