智者,既能奋发不休,又能尽人事,顺天命
分类: LINUX
2010-03-10 09:44:58
在ABS中看到一个例子:
# echo "This will print \
这个echo仅仅会输出一行,不是很理解,查了一下bash的manual,原来这是一个特殊用法:
3.1.2.1 Escape Character
A non-quoted backslash ‘\’ is the Bash escape character. It preserves the literal value of the next character that follows, with the exception of newline. If a \newline pair appears, and the backslash itself is not quoted, the \newline is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).
在双引号中也提到了newline,从实际例子中来看,处理方法是一样的。