Strange "?" got added to the filename output.
SCRIPTS="/path_to_script/"
SUMMER=`cat /path_to_file/summer.txt`
for i in ${SUMMER};
do cat <<- EOF > $SCRIPTS/20190430_$(echo ${i})_step4.r
#content omit
EOF
done
Expected ourput would be
20190430_spring1_step4.r
20190430_spring2_step4.r
20190430_summer1_step4.r
20190430_summer2_step4.r
But I got the question mark after each variable except the last row from the ${SUMMER}
.
20190430_spring1?_step4.r
20190430_spring2?_step4.r
20190430_summer1?_step4.r
20190430_summer2_step4.r
What is the problem?
${SUMMER}
is a txt file with only one column
?
), or dollar ($
)? – ctrl-alt-delor Apr 30 '19 at 18:56