I want to print the content that I have obtained from the split of an array in this way:
string=\"abc test;ABCtest.it\"
IFS=\';\' read -a array <<<
Somehow, the value of $string
ends with a carriage return. What you are actually echoing is
echo -ne "\nABCtest.it\r,abc test"
That carriage return causes the cursor to move to the beginning of the current line before printing the text that follows it, overwriting the url. Either remove the carriage return with
string=${string#?}
or fix how string
is set in the first place (I suspect you are reading from a file that uses DOS line endings, in which case you can convert the file with dos2unix
.)