lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master fb607c1: Add a throwaway script


From: Greg Chicares
Subject: [lmi-commits] [lmi] master fb607c1: Add a throwaway script
Date: Thu, 18 Jun 2020 07:45:40 -0400 (EDT)

branch: master
commit fb607c14174911afc728032ae528dfa503dd3910
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Add a throwaway script
---
 gwc/foo | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gwc/foo b/gwc/foo
new file mode 100755
index 0000000..cf31ed5
--- /dev/null
+++ b/gwc/foo
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -vx
+
+CHROOT_USERS=$(getent group "lmi" | cut -d: -f4)
+CHROOT_UIDS=
+for user in $(echo "${CHROOT_USERS}" | tr ',' '\n'); do
+  echo "${user}" "$(id -u "${user}")"
+  CHROOT_UIDS="${CHROOT_UIDS} $(id -u "${user}")"
+done
+echo "${CHROOT_USERS}"
+echo "${CHROOT_UIDS}"
+
+i=0
+for i in 1 2 3 4; do
+  echo "${CHROOT_UIDS}" | cut -d' ' -f"${i}"
+done
+
+echo "${CHROOT_UIDS}" | cut -d' ' -f1
+echo "${CHROOT_UIDS}" | cut -d' ' -f2
+echo "${CHROOT_UIDS}" | cut -d' ' -f3
+echo "${CHROOT_UIDS}" | cut -d' ' -f4
+
+i=1
+while [ "$i" -ne 10 ]
+do
+    echo "$i"
+    i=$((i + 1))
+done



reply via email to

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