From cbf784de8a20a6a6bfdaf9ee33eba996f09c5bbd Mon Sep 17 00:00:00 2001 From: hophacker Date: Sat, 3 Aug 2019 23:41:22 +0800 Subject: [PATCH] get_ip_of_ssh_hostname --- zsh/functions.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zsh/functions.zsh b/zsh/functions.zsh index a8980dc..c22ba21 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -348,3 +348,6 @@ function dc { fi docker-compose -f $docker_file_path $@ } +function get_ip_of_ssh_hostname { + ssh -G $1 | awk '/^hostname / { print $2 }' +}