Skip to content

./bin/install.sh中读到两条本机ip #96

@5herhom

Description

@5herhom

ipaddr=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(.*)\/(.*)/, "\\1", "g", $2)}')

该行在这台CentOS Linux release 7.2.1511(Core)下返回了两条ip。
如图所示:
image

原因:这台机器执行ip addr时,172.17.0.1也满足这条awk,ip addr内容如下:
image

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