diff --git a/doc_src/tutorial.hdr b/doc_src/tutorial.hdr index 034a5035b..bc4df3bd7 100644 --- a/doc_src/tutorial.hdr +++ b/doc_src/tutorial.hdr @@ -391,6 +391,17 @@ Command substitutions are not expanded within quotes. Instead, you can temporari testing_1360099791.txt \endfish +Unlike other shells, fish does not split command substitutions on any whitespace (like spaces or tabs), only newlines. This can be an issue with commands like `pkg-config` that print what is meant to be multiple arguments on a single line. To split it on spaces too, use `string split`. + +\fish{cli-dark} +>_ printf '%s\n' (pkg-config --libs gio-2.0) +-lgio-2.0 -lgobject-2.0 -lglib-2.0 +>_ printf '%s\n' (pkg-config --libs gio-2.0 | string split " ") +-lgio-2.0 +-lgobject-2.0 +-lglib-2.0 +\endfish + \section tut_combiners Combiners (And, Or, Not)