On Redhat linux environment, my Bash script (setup
) contains the following lines of code:
#!/bin/bash
#CASE_C3
export RUN_FILES_LOCATION="./Run_Files/"
export CPP_FILE="${RUN_FILES_LOCATION}/APP77.ME"
echo $CPP_FILE
Running source setup
in the terminal gives the following output:
/APP77.MEes/
Expected output:
./Run_Files//APP77.ME
It seems like somehow the variable is being overwritten byte-by-byte instead of concatenated. But I am following the exact syntax for concatenating strings in Bash. Why does that happen?
When I run the exact same lines of code in the terminal, I get the expected output. It's only running through a bash script does the result turn out incorrectly.