Refactor v-change-wordpress-admin-passwords to streamline admin list processing by using a here-string for input

This commit is contained in:
Peca 2025-07-14 18:17:43 +02:00
commit ca9a939823

View file

@ -62,12 +62,12 @@ ADMIN_LIST_CSV=$(eval "$RUN")
DEFAULT_USER=""
printf "%-6s %-20s %s\n" "ID" "Username" "Email"
echo "$ADMIN_LIST_CSV" | while IFS=',' read -r PID PLOGIN PEMAIL; do
while IFS=',' read -r PID PLOGIN PEMAIL; do
printf "%-6s %-20s %s\n" "$PID" "$PLOGIN" "$PEMAIL"
if [ "$PID" = "1" ]; then
DEFAULT_USER="$PLOGIN"
fi
done
done <<< "$ADMIN_LIST_CSV"
echo
echo "For each admin choose: (d) delete, (c) change password, (s) skip, (x) exit."