\r carriage return \t horizontal tab \v vertical tab \0NNN byte with octal value NNN (1 to 3 digits) \xHH byte with hexadecimal value HH (1 to 2 digits) NOTE: your shell may have its own version of echo, which usually supersedes the version described here. Please refer to your shel...
Words of the form $'string' are treated specially. The word expands to string, with backslash-escaped characters replaced as specified by the ANSI C standard. Backslash escape sequences, if present, are decoded as follows: 复制 \n new line\r carriage return\t horizontal tab\' single quote ...
Bashoffers two types of commands that can be used to print your output to the terminal. One is theechocommand which is mostly used for this purpose. The second is theprintfcommand. Printfis similar to theprintf functioninClanguage but with its own set of features. The main difference between...
As a beginner when you start working with Bash scripts, the first command you will probably learn and use is theechocommand. You can think ofbash echocommand something similar to theprintcommand in other programming languages. Theechocommand is a bash built-in and its purpose is to print the...
/bin/bashecho"Testing the Carriage Return Character"echo"Behavior"echo"Wow! It works" 预期输出(没有错误): Testing the Carriage Return Character Behavior Wow! It works 我们保存了默认Windows风格结尾的脚本文件,运行脚本文件的结果如下。 虽然它仍然输出 echo 语句,但它给了我们'\r': command not found...
\r carriage return \s the name of the shell, the basename of $0 (the portion following the final slash) \t the current time in 24-hour HH:MM:SS format \T the current time in 12-hour HH:MM:SS format \@ the current time in 12-hour am/pm format ...
\r carriage return \t horizontal tab \' single quote The expanded result is single-quoted, as if the dollar sign had not been present.即,$'string' 这个写法可以使⽤ C 语⾔的转义字符来获取到对应的字符⾃⾝。判断⽂件的最后⼀⾏是否以换⾏符结尾 在 Linux 中,可以使⽤下...
Testing the Carriage Return Character Behavior Wow! It works We saved the script file with the default Windows-style endings, and the result of running the script file is below. Though it still outputs the echo statements, it gives us the '\r': command not found. Let’s save the same...
\rCarriage return\u000D \fForm feed\u000C \nNew line\u000A \aBell (alarm)\u0007 \c char...
carriage return \t horizontal tab \v vertical tab \\ backslash \nnn the character whose ASCII code is nnn (octal) enable [-n] [-all] [name ...] Enable and disable builtin shell commands. This allows the execution of a disk command which has the same name as a shell builtin without...