When go through -r line; do # $'n' prints a newline so we do not have to understand what Unique chars the string consists of stringBuilder+="$line"$'n' Having said that in case you have been to replace printf with echo in this example, echo would handle n to be a string, https://petskyonline-onlinestrore.blogspot.com/2025/07/the-day-my-cat-got-automatic-feeder-and.html