What’s the difference between \\n
(newline) and \\r
(carriage return)?
In particular, are there any practical differences between
To complete,
In a shell (bash) script, you can use \r
to send cursor, in front on line and, of course \n
to put cursor on a new line.
For example, try :
echo -en "AA--AA" ; echo -en "BB" ; echo -en "\rBB"
AA--AA
AA--AABB
BB--AABB
But don't forget to use -en
as parameters.