Skip to main content
added 4 characters in body
Source Link
ilkkachu
  • 148k
  • 16
  • 268
  • 441

I was practicing echo command with option \r\r (carriage return) as below.

echo -e "This is \r my college"

echo -e "This is \r my college" 

output  : my college

 my college 

but when iI add one more word before \r\r as below

echo -e "This is the \r my college"

echo -e "This is the \r my college" 

Then it gives me output like  : my college the Another

 my college the 

Another example

echo -e "This is \r valid data" output: valid data

echo -e "This is not a \r valid data" output: valid data a

echo -e "This is \r valid data" valid data echo -e "This is not a \r valid data" valid data a 

so iSo, I wanted to know that what is the actual purpose of carriage return here?

I was practicing echo command with option \r (carriage return) as below.

echo -e "This is \r my college"

output  : my college

but when i add one more word before \r as below

echo -e "This is the \r my college"

Then it gives me output like  : my college the Another example

echo -e "This is \r valid data" output: valid data

echo -e "This is not a \r valid data" output: valid data a

so i wanted to know that what is the actual purpose of carriage return here?

I was practicing echo command with option \r (carriage return) as below.

echo -e "This is \r my college" 

output:

 my college 

but when I add one more word before \r as below

echo -e "This is the \r my college" 

Then it gives me output like:

 my college the 

Another example

echo -e "This is \r valid data" valid data echo -e "This is not a \r valid data" valid data a 

So, I wanted to know that what is the actual purpose of carriage return here?

edited tags
Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k
added 149 characters in body
Source Link
Dip
  • 740
  • 3
  • 9
  • 13

I was practicing echo command with option \r (carriage return) as below.

echo -e "This is \r my college"

output : my college

but when i add one more word before \r as below

echo -e "This is the \r my college"

Then it gives me output like : my college the Another example

echo -e "This is \r valid data" output: valid data

echo -e "This is not a \r valid data" output: valid data a

so i wanted to know that what is the actual purpose of carriage return here?

I was practicing echo command with option \r (carriage return) as below.

echo -e "This is \r my college"

output : my college

but when i add one more word before \r as below

echo -e "This is the \r my college"

Then it gives me output like : my college the

so i wanted to know that what is the actual purpose of carriage return here?

I was practicing echo command with option \r (carriage return) as below.

echo -e "This is \r my college"

output : my college

but when i add one more word before \r as below

echo -e "This is the \r my college"

Then it gives me output like : my college the Another example

echo -e "This is \r valid data" output: valid data

echo -e "This is not a \r valid data" output: valid data a

so i wanted to know that what is the actual purpose of carriage return here?

added 76 characters in body
Source Link
Dip
  • 740
  • 3
  • 9
  • 13
Loading
Source Link
Dip
  • 740
  • 3
  • 9
  • 13
Loading