summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/make.texi58
1 files changed, 50 insertions, 8 deletions
diff --git a/doc/make.texi b/doc/make.texi
index f51fe32..4f07338 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -3565,17 +3565,59 @@ foo : bar/lose
@cindex @code{\} (backslash), in commands
@cindex quoting newline, in commands
@cindex newline, quoting, in commands
-If you would like to split a single shell command into multiple lines of
-text, you must use a backslash at the end of all but the last subline.
-Such a sequence of lines is combined into a single line, by deleting the
-backslash-newline sequences, before passing it to the shell. Thus, the
-following is equivalent to the preceding example:
+A shell command can be split into multiple lines of text by placing a
+backslash before each newline. Such a sequence of lines is provided
+to the shell as a single command script. The backslash and newline
+are preserved in the shell command. If the first character on the
+line after a backslash-newline is a tab, the tab will @emph{not} be
+included in the shell command. So, this makefile:
@example
@group
-foo : bar/lose
- cd bar; \
- gobble lose > ../foo
+all :
+ @@echo no\
+space
+ @@echo no\
+ space
+@end group
+@end example
+
+consists of two separate shell commands where the output is:
+
+@example
+@group
+nospace
+nospace
+@end group
+@end example
+
+As a more complex example, this makefile:
+
+@example
+@group
+all : ; @@echo 'hello \
+ world' ; echo "hello \
+ world"
+@end group
+@end example
+
+will run one shell with a command script of:
+
+@example
+@group
+echo 'hello \
+world' ; echo "hello \
+ world"
+@end group
+@end example
+
+which, according to shell quoting rules, will yield the following output:
+
+@example
+@group
+hello \
+world
+hello world
@end group
@end example