From 203d20bb11a6de2fb7f96b9188a189d683d98153 Mon Sep 17 00:00:00 2001 From: ThomasC Date: Wed, 2 Jun 2021 17:14:54 +0200 Subject: [PATCH] user variable deleted at each iteration --- localeval.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localeval.sh b/localeval.sh index 29a8b44..cd49ee5 100644 --- a/localeval.sh +++ b/localeval.sh @@ -1,5 +1,5 @@ #! /bin/bash -set -eu +set -e IFS=$'\n\t' source functions.sh echo -ne "host;name;root history;bash history;<+CHANGEME+>\n" @@ -14,10 +14,10 @@ for host in $hostlist ; do hostname=$(grep HOSTNAME ${root}/etc/sysconfig/network 2>/dev/null| cut -f2 -d=) test -z "${hostname}" && hostname=$(cat ${root}/etc/hostname) test -f ${root}/etc/motd && user="$(cat ${root}/etc/motd | xargs)" - test -z "$user" && continue echo -ne "${hostname};${user};" fileMTime ${root}/root/.bash_history fileMTime ${root}/home/formation/.bash_history + unset user echo