A maneira mais simples é usar unset
:
$ options=(aa bb cc dd)
$ echo ${options[@]}
aa bb cc dd
## Remove the 3d element of the array (arrays start at 0)
$ unset options[2]
$ echo ${options[@]}
aa bb dd
Para mais detalhes, consulte help unset
:
unset: unset [-f] [-v] [name ...]
Unset values and attributes of shell variables and functions.
For each NAME, remove the corresponding variable or function.
Options:
-f treat each NAME as a shell function
-v treat each NAME as a shell variable
Without options, unset first tries to unset a variable, and if that fails,
tries to unset a function.
Some variables cannot be unset; also see 'readonly'.
Exit Status:
Returns success unless an invalid option is given or a NAME is read-only.