Docs for "$(cmd)" and $(cmd)

This commit is contained in:
Johannes Altmanninger
2021-07-02 23:11:03 +02:00
parent 0ab6735450
commit 5999d660c0
4 changed files with 14 additions and 4 deletions

View File

@@ -400,11 +400,11 @@ Unlike other shells, fish does not split command substitutions on any whitespace
-lgobject-2.0
-lglib-2.0
If you need a command substitutions output as one argument, without any splits, use ``string collect``::
If you need a command substitutions output as one argument, without any splits, use quoted command substitution::
> echo "first line
second line" > myfile
> set myfile (cat myfile | string collect)
> set myfile "$(cat myfile)"
> printf '|%s|' $myfile
|first line
second line|