1
0
Fork 0

zsh: add hosthost function

This commit is contained in:
Luca Bilke 2024-11-13 18:30:29 +01:00
parent 92c4fed0b5
commit 193c737232
Signed by: luca
GPG key ID: F6E11C9BAA7C82F5

View file

@ -14,6 +14,16 @@ function xsi() {
}
function whed() {
local script
script=$(which "$1")
[ -e "$script" ] && $EDITOR $(which "$script")
}
function hosthost() {
local ip
ip=$(
host -t A "$1" | awk '{print $4}' ||
host -t AAAA "$1" | awk '{print $5}'
)
host "$ip" | awk '{print $5}' | sed 's/.$//'
}