Skip to content

array.md 删除数组元素 #30

Closed
Closed

Description

@eagleoflqj

如果对数组元素赋值空字符串,不能起到删除元素的效果

a=(x y z)
a[1]=''
declare -p a
echo ${#a[@]} # 还是3
echo ${!a[@]} # 0 1 2

Activity

  1. ruanyf commented on Jun 11, 2020

    @ruanyf
    Contributor

    谢谢指出,已经改正。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions