Name

mk_here_list — Read quoted list from here document

Synopsis

mk_here_list [var]

Description

Returns a quoted list by reading each line from stdin and stripping leading and trailing whitespace. If var is specified, it is taken as the name of the variable to set to the result; otherwise, result is used.

This function allows quoted lists to be constructed from so-called here documents with a single item per line.

Examples

FOO=foo
mk_text_list HUGE_TARGET_LIST <<EOF
    ${FOO}/bar
    ${FOO}/baz
    ...
EOF
echo "$HUGE_TARGET_LIST"
# Output: 'foo/bar' 'foo/baz' ...