Strip all newlines from ifconfig output

This commit is contained in:
Dominik Ritter 2019-02-22 18:16:33 +01:00
parent fef639eb48
commit 1049bca473

View File

@ -405,7 +405,7 @@ function p9k::parseIp() {
continue
fi
# Check if interface is UP.
if [[ "${interface/${newline}/}" =~ "<([^>]*)>(.*)inet[ ]+([^ ]*)" ]]; then
if [[ "${interface//${newline}/}" =~ "<([^>]*)>(.*)inet[ ]+([^ ]*)" ]]; then
local ipFound="${match[3]}"
local -a interfaceStates=(${(s:,:)match[1]})
if [[ "${interfaceStates[(r)UP]}" == "UP" ]]; then