Just like the title.
root@localhost:~# echo -e "\n" root@localhost:~#
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
By default echo will output a newline character. So adding the specified "n", a total of two will be output.
echo
-n Don’t automatically wrap the line at the end
So you can pass echo -n to not output the default newline.
echo -n
The principle is explained by the two classmates above. If the questioner needs to output a blank line, this is fine
Because the echo command itself appends a newline character to the output string by default, you can prevent this default behavior by adding an option -n:
-n
echo -ne "\n"
By default
echo
will output a newline character. So adding the specified "n", a total of two will be output.So you can pass
echo -n
to not output the default newline.The principle is explained by the two classmates above. If the questioner needs to output a blank line, this is fine
Because the
echo
command itself appends a newline character to the output string by default, you can prevent this default behavior by adding an option-n
: