Difference between echo and echo -e in Shell script
echo:
It is used to print the line of text which are given between the double quotes(“….”). Literally it just print out as it is.
Example for echo
1 |
echo "Hi\n How are you? \nWhere are you from?" |
Output:
Hi\n How are you? \nWhere are you from?
echo -e:
It making echo to interpret backslash escapes while print text.
Example for echo -e
1 |
echo -e "Hi\n How are you? \nWhere are you from?" |
Output:
Hi
How are you?
Where are you from?