lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 646e523 1/6: Define a variable immediately be


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 646e523 1/6: Define a variable immediately before use
Date: Thu, 5 Mar 2020 11:31:46 -0500 (EST)

branch: master
commit 646e52345534db33d0e248a024cd1fe3e7cf6c0f
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Define a variable immediately before use
---
 install_redhat.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/install_redhat.sh b/install_redhat.sh
index 5a50909..d2e6f7c 100755
--- a/install_redhat.sh
+++ b/install_redhat.sh
@@ -28,9 +28,6 @@ set -evx
 stamp0=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
 echo "Started: $stamp0"
 
-# Timestamp usable as a component of a portable filename.
-fstamp=$(date -u +"%Y%m%dT%H%MZ" -d "$stamp0")
-
 assert_su
 assert_not_chrooted
 
@@ -165,6 +162,8 @@ schroot --chroot=${CHRTNAME} --preserve-environment 
--user="${NORMAL_USER}" --di
 
 # Copy log files that may be useful for tracking down problems with
 # certain commands whose output is voluminous and often uninteresting.
+# Embed a timestamp in the copies' names (no colons, for portability).
+fstamp=$(date -u +"%Y%m%dT%H%MZ" -d "$stamp0")
 cp -a /srv/chroot/${CHRTNAME}/home/"${NORMAL_USER}"/log 
/home/"${NORMAL_USER}"/lmi_rhlog_"${fstamp}"
 cp -a /srv/chroot/${CHRTNAME}/tmp/${CHRTNAME}-apt-get-log 
/home/"${NORMAL_USER}"/apt-get-log-"${fstamp}"
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]