Echo command

In unix what is the purpose to use echo with the option "-e"??
i.e echo -e

Questions by name is abhisek

Showing Answers 1 - 4 of 4 Answers

Manish Singh

  • Dec 2nd, 2012
 

-e option tells echo to consider the escape sequences in the statement.

e.g. echo "Without hyphen e option
It will be the same"
Output :: Without hyphen e option
It will be the same

echo -e "With hyphen e option
It will be different"
Output :: With hyphen e option
It will be different


  Was this answer useful?  Yes

PARUL SHARMA

  • Dec 8th, 2014
 

For better understanding consider the example

Code
  1. echo "welcome to geekinterview

  2. have a nice day""welcome to geekinterview

  3. have a nice day"


here
for new line
for a tab etc.

  Was this answer useful?  Yes

Gaurav Khurana

  • Jan 9th, 2015
 

For me its printing -e also
[/home/gk]=> echo -e "is it different"
-e is it different
[/home/gk]=> echo "is it different"
is it different
My unix is Sun OS 5.10

  Was this answer useful?  Yes

abhinav

  • Jan 19th, 2016
 

echo -e /nabhinav
in this first a blank line will be printed after that in next line abhinav. -e is used for special symbols

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions