In Linux, you can use the "-n" parameter of the echo command to achieve no line breaks; the echo command is similar to the PHP echo command and is used to output strings. When the parameter is set to "-n" When , the newline symbol at the end of the line after output will be canceled, that is, the content will not break after being output, and the syntax is "echo -n output content".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
In linux, the echo command is used to output strings, the syntax is "echo [option] [output content]"; if there is no special meaning in the output content , the original content is output to the screen; if the output content has a special meaning, the meaning is printed.
The echo command is similar to PHP’s echo command, both are used for string output.
The command format is as follows:
# echo [选项] [输出内容]
Options:
-e: Supports character conversion controlled by backslash
-n: Cancel the newline symbol at the end of the line after output (no line break after the content is output)
The example is as follows:
[root@localhost ~]# echo -n "c.biancheng.net" c.biancheng.net[root@localhost ~]#
#If added If the "-n" option is specified, after the output content is completed, the new line will not be wrapped and the prompt for the new line will be directly displayed.
The example is as follows:
Recommended Learn:Linux Video Tutorial
The above is the detailed content of Why does echo not wrap in linux?. For more information, please follow other related articles on the PHP Chinese website!