From 08359dd760f52624a77d9c2500b48fa525a463aa Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Thu, 19 Oct 2023 18:35:32 +0800 Subject: [PATCH] fix: ignore empty line or #line --- misc/cpsshkey.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/cpsshkey.sh b/misc/cpsshkey.sh index d8735427..8aa933d0 100644 --- a/misc/cpsshkey.sh +++ b/misc/cpsshkey.sh @@ -10,6 +10,9 @@ fi #分发到各个节点,这里分发到nehosts文件中的主机中. while read line do + if [[ "$line" =~ ^[^[:space:]]*# || -z "$line" ]]; then + continue + fi user=`echo $line | cut -d " " -f 2` ip=`echo $line | cut -d " " -f 1` passwd=`echo $line | cut -d " " -f 3`