From b1094e84929bc95955e4403b7d76bcd4a76f7d55 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Thu, 8 May 2025 10:03:47 +0300 Subject: [PATCH] {bash,zsh}rc: add quick hack for ifconfig IPv4 addresses --- rc/bashrc | 5 +++++ rc/zshrc | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/rc/bashrc b/rc/bashrc index 5d81c50f..856b92c8 100755 --- a/rc/bashrc +++ b/rc/bashrc @@ -145,6 +145,11 @@ if hash lsb_release 2> /dev/null; then elif hash hostnamectl 2> /dev/null; then hostnamectl hostname & fi + + if hash ifconfig 2> /dev/null; then + \LC_ALL=C.utf8 \ifconfig | \grep inet | \grep -Ev "127.0.0.1|inet6" + fi + printf "\n" printf "$(uptime --pretty)\t$(uptime)\n" printf "\nPresent:\n" diff --git a/rc/zshrc b/rc/zshrc index 7bc33507..c44f640b 100755 --- a/rc/zshrc +++ b/rc/zshrc @@ -42,6 +42,11 @@ if hash lsb_release 2> /dev/null; then elif hash hostnamectl 2> /dev/null; then hostnamectl hostname & fi + + if hash ifconfig 2> /dev/null; then + LC_ALL=C.utf8 \ifconfig | \grep inet | \grep -Ev "127.0.0.1|inet6" + fi + printf "\n" printf "$(uptime --pretty)\t$(uptime)\n" printf "\nPresent:\n"