On Thu, Feb 02, 2017 at 02:32:00PM +0530, Sangamesh Mallayya wrote: > in bash echo -n , echo -e , echo -E has a special meaning. But we do not > have a way in bash shell if we want to print > -n , -e and -E using echo command. Other shells supports printing of > -n/-e/-E options using echo command.
Use printf instead of echo. printf '%s\n' "$myvariable" This will work regardless of the contents of the variable. echo is deprecated, and should not be used unless you are certain that it will not be given an argument that could be misinterpreted as an option. E.g. this is fine: echo "You scored $points points." This is not fine: echo "$foo" This was NEVER acceptable and you should not even THINK it: echo $foo