lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 41614ca 2/3: Do nothing in an 'xargs' command


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 41614ca 2/3: Do nothing in an 'xargs' command if input is empty
Date: Tue, 12 May 2020 17:00:33 -0400 (EDT)

branch: master
commit 41614caa517ba22276a411aaece0cab213d32144
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Do nothing in an 'xargs' command if input is empty
---
 install_centos.sh | 2 +-
 install_redhat.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/install_centos.sh b/install_centos.sh
index fd8d597..464bf8f 100755
--- a/install_centos.sh
+++ b/install_centos.sh
@@ -56,7 +56,7 @@ assert_su
 assert_not_chrooted
 
 # First, destroy any chroot left by a prior run.
-grep centos /proc/mounts | cut -f2 -d" " | xargs umount
+grep centos /proc/mounts | cut -f2 -d" " | xargs --no-run-if-empty umount
 rm -rf /srv/chroot/centos7lmi
 rm /etc/schroot/chroot.d/centos7lmi.conf
 
diff --git a/install_redhat.sh b/install_redhat.sh
index 1ce4e6d..d3f8d75 100755
--- a/install_redhat.sh
+++ b/install_redhat.sh
@@ -56,7 +56,7 @@ assert_su
 assert_not_chrooted
 
 # First, destroy any chroot left by a prior run.
-grep "${CHRTNAME}" /proc/mounts | cut -f2 -d" " | xargs umount || echo "None?"
+grep "${CHRTNAME}" /proc/mounts | cut -f2 -d" " | xargs --no-run-if-empty 
umount
 rm -rf /srv/chroot/"${CHRTNAME}"
 rm /etc/schroot/chroot.d/"${CHRTNAME}".conf || echo "None?"
 umount /srv/chroot



reply via email to

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