Skip to content

Commit f76ff3e

Browse files
committed
Project import generated by Copybara.
PiperOrigin-RevId: 306352475
1 parent 305ac87 commit f76ff3e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

shellguide.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,16 @@ mybinary ${flags}
809809
# Command expansions return single strings, not arrays. Avoid
810810
# unquoted expansion in array assignments because it won’t
811811
# work correctly if the command output contains special
812-
# characters.
812+
# characters or whitespace.
813+
814+
# This expands the listing output into a string, then does special keyword
815+
# expansion, and then whitespace splitting. Only then is it turned into a
816+
# list of words. The ls command may also change behavior based on the user's
817+
# active environment!
813818
declare -a files=($(ls /directory))
819+
820+
# The get_arguments writes everything to STDOUT, but then goes through the
821+
# same expansion process above before turning into a list of arguments.
814822
mybinary $(get_arguments)
815823
```
816824

0 commit comments

Comments
 (0)