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.

5
  • 1
    You need arr=("$@")
    – A.B.
    Commented Sep 15, 2015 at 9:38
  • To see the difference, add a break below echo "$i". In your version you will still see all the elements. However, it should be three lines.
    – A.B.
    Commented Sep 15, 2015 at 9:43
  • @heemayl: small typo -- The { in your array of the second bullet went missing ... "${array[@]}" ...
    – Cbhihe
    Commented Sep 15, 2015 at 17:36
  • At the very end of the last bullet point is there also a missing {, or is this intentional arr="$arr[@]}" ?
    – Davos
    Commented Jun 10, 2021 at 14:15
  • 1
    @Davos Typo. Fixed.
    – heemayl
    Commented Jun 10, 2021 at 15:47