Error "Waiting for 1 running process to finish before terminating, wait limit unlimited seconds"

22 views
Skip to first unread message

Jorge Silva

unread,
Feb 6, 2026, 5:28:54 AMFeb 6
to GAM for Google Workspace
I have this script:

#!/bin/bash

# To replace a teacher
# Usage: gam-subst-prof user_out user_in

if [[ "$1" == "--help" || "$2" == "--help" || -z $1 || -z $2 ]]; then
echo "Este comando utiliza o GAMADV-XTD3 para substituir um utilizador nos grupos dos CT anuais."
echo "EX: gam-subst-prof user_out user_in"
exit 1
fi

gam print groups member $1 emailmatchpattern '^25.*' | gam csv - gam update group "~email" add user $2
gam print groups member $1 emailmatchpattern '^25.*' | gam csv - gam update group "~email" remove user $1

Starting some days ago (I have no idea which version it started with), I'm getting this error: 

Waiting for 1 running process to finish before terminating, wait limit unlimited seconds

What could possibly go wrong?

Is it possible to make this script more efficient?

Thank you all.

Sanjyot Thorat

unread,
Feb 6, 2026, 10:10:21 AMFeb 6
to google-ap...@googlegroups.com
#!/bin/bash

if [[ "$1" == "--help" || "$2" == "--help" || -z $1 || -z $2 ]]; then
    echo "Este comando utiliza o GAMADV-XTD3 para substituir um utilizador nos grupos dos CT anuais."
    echo "EX: gam-subst-prof user_out user_in"
    exit 1
fi

USER_OUT="$1"
USER_IN="$2"

TMPFILE=$(mktemp)

# Get group list once
gam print groups member "$USER_OUT" emailmatchpattern '^25.*' > "$TMPFILE"

# Add new user
gam csv "$TMPFILE" gam update group "~email" add user "$USER_IN"

# Remove old user
gam csv "$TMPFILE" gam update group "~email" remove user "$USER_OUT"

rm -f "$TMPFILE"







👆Try this code it will run properly 

────────────────────────────────────────────────────
Agrupamento de Escolas de Águas Santas - 152961
[ Escola Básica e Secundária de Águas Santas - Sede - 403398 ]
Rua Nova do Corim | 4425-151 ÁGUAS SANTAS
[T] +351 229 712 570 | [M] +351 936 541 534 | [F] +351 229 720 212
[w] https://portal.aescas.net | [@] ge...@aescas.net | [f] https://facebook.com/aescas

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-manager/ea051699-c19d-49d4-9aae-78b4b145a4fcn%40googlegroups.com.

Jorge Silva

unread,
Feb 7, 2026, 7:16:16 AMFeb 7
to GAM for Google Workspace
Sanjyot Thorat, thank you!
Reply all
Reply to author
Forward
0 new messages