aexprot bash варьируется для другого сценария

script 1 #############
rr=`echo $directory_rr | awk '{split($1,a,"/"); print a[2]}'`
 . /location/profiles.sh 

#this "." /location/profiles.sh is very important for sourcing


script 2#################

grep Etot location/md.out | awk -v env_var="$rr" do something  > mm_prof_$rr


Hutch Polecat