Let me guess: you edited that script on Windows.
Correct? Your scripts have Windows line endings: CR LF instead of just LF which is the unix line ending character. As far as the shell is concerned, that CR is part of the command, so the value of ROOT
contains a CR at the end, and when you print it out, the CR moves the cursor back to the beginning of the line.
The fix is not to edit scripts on Windows, or else to make sure your editor uses unix line endings. Be sure to convert your existing script(s).
See also Directories are listed twice and Carriage return issue