-n option with ECHO command in Linux [closed]

老子叫甜甜 提交于 2020-05-08 06:12:50

问题


What is the use for the -n flag with the echo command in Linux?

echo -n

回答1:


man echo

 -n    Do not print the trailing newline character.  This may also be achieved by appending `\c' to the end of the string, as is done
       by iBCS2 compatible systems.  Note that this option as well as the effect of `\c' are implementation-defined in IEEE Std
       1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002.  Applications aiming for maximum portability are strongly encouraged to
       use printf(1) to suppress the newline character.

Many built-in commands to Linux have a man page (e.g. man ls), which is a great way to look at the manual without having to search online.



来源:https://stackoverflow.com/questions/20499578/n-option-with-echo-command-in-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!