mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2026-09-30 00:34:42 +00:00
Strip all newlines from ifconfig output
This commit is contained in:
@@ -405,7 +405,7 @@ function p9k::parseIp() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
# Check if interface is UP.
|
# Check if interface is UP.
|
||||||
if [[ "${interface/${newline}/}" =~ "<([^>]*)>(.*)inet[ ]+([^ ]*)" ]]; then
|
if [[ "${interface//${newline}/}" =~ "<([^>]*)>(.*)inet[ ]+([^ ]*)" ]]; then
|
||||||
local ipFound="${match[3]}"
|
local ipFound="${match[3]}"
|
||||||
local -a interfaceStates=(${(s:,:)match[1]})
|
local -a interfaceStates=(${(s:,:)match[1]})
|
||||||
if [[ "${interfaceStates[(r)UP]}" == "UP" ]]; then
|
if [[ "${interfaceStates[(r)UP]}" == "UP" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user