Concatenate strings in bash
bash
Solution
You should try
SORT="${CC}${i}"
Make sure your file does not contain "\r" that would end just in the end of $CC. This could well explain why you get "1ODAY".
Try including |tr '\r' '' after the cat command
Problem
I have in a bash script: ``` for i in `seq 1 10` do read AA BB CC <<< $(cat file1 | grep DATA) echo ${i} echo ${CC} SORT=${CC}${i} echo ${SORT} done ``` so "i" is a integer, and CC is a string like "TODAY" I would like to get then in `SORT`, "TODAY1", etc But I get "1ODAY", "2ODAY" and so Where is the error? Thanks