Question on shell scripts
We have Redhat linux 5.5
I am writing a very simple bash shell script which consists of the following: ------------------------------------------ MainTest.sh Shell script contents ------------------------------------------ DT_STAMP=`date +%Y%m%d%H%M` echo $DT_STAMP . ./pos_profile.sh echo $LOG_FLD LOG="$LOG_FLD$DT_STAMP.log" echo "beforelog" echo $LOG echo "This is a test" > $LOG ------------------------------------------ pos_profile.sh contents ------------------------------------------ export RCD_FILE="file_name*.zip" export LOG_FLD="/home/stage_location/" ------------------------------------------ When MainTest.sh is executed, this is the output i get 201008161546 /home/stage_location/ beforelog 201008161546.log As you can see the LOG variable is set to only DT_STAMP.log. the value of $LOG_FLD is missing Can somebody please help me understand what is it that I may be missing? |
Code:
MainTest.sh Shell script contents |
And how (from where) are you invoking MainTest.sh?
|
That's a very wrong behavior. Can you directly echo "$LOG_FLD$DT_STAMP.log"?
Code:
echo "$LOG_FLD$DT_STAMP.log" |
All times are GMT -5. The time now is 07:32 AM. |