added double quote character for awk parsing first colums

This commit is contained in:
2023-10-16 02:02:48 +00:00
parent de23694368
commit a2301e7172

View File

@@ -68,7 +68,8 @@ name_resolver() {
#EXISTS=$(grep -w "$D-" $HOST_FILE); # TODO? #EXISTS=$(grep -w "$D-" $HOST_FILE); # TODO?
if [ -n "$EXISTS" ]; then # selector exists in hosts file if [ -n "$EXISTS" ]; then # selector exists in hosts file
# remove all matching selectors and all selctors followed by "-" # remove all matching selectors and all selctors followed by "-"
APP_IP=$(echo $EXISTS | sed s/$D-.//g | sed s/$D//g); #APP_IP=$(echo $EXISTS | sed s/$D-.//g | sed s/$D//g);
APP_IP=$(echo "$EXISTS" | awk '{print $1}');
debug "APP_IP: "$APP_IP; debug "APP_IP: "$APP_IP;
else else
debug "no matching APPLICATION NAME found in $HOST_FILE" debug "no matching APPLICATION NAME found in $HOST_FILE"