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
  • @gniourf_gniourf there is no need to use quotes for the argument of unset. Commented Aug 15, 2019 at 7:06
  • 8
    @jarno: these quotes MUST be used: if you have a file named array0 in the current directory, then since array[0] is glob, it will first be expanded to array0 before the unset command. Commented Aug 15, 2019 at 8:06
  • @gniourf_gniourf you are correct. This should be corrected in Bash Reference Manual that currently says "unset name[subscript] destroys the array element at index subscript". Commented Aug 15, 2019 at 8:24