Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Re ¹: Shame, as that basically means you still have to quote many array expansions just in case, particularly when passing along arguments. I take it there's no option to disable that misfeature? Commented Jul 28, 2022 at 12:34
  • 1
    @ak2, not that many as most of the time, at least in my experience, arrays are used for lists of files or in general things other than the empty string. Note that you need "$array[@]" or "${(@)array}", to expand to all the elements including empty ones. "$array" is like "$array[*]" which is the elements joined with the first character of $IFS. Commented Jul 28, 2022 at 12:43
  • Thank you. Luckily, for script/function arguments, there's the still quite concise "$@". Commented Jul 28, 2022 at 13:13