Jump to content

Until loops

From Squishu Wiki

General

  • here the loop continues until the condition becomes true, not while the condition is true
  • It's good for continuing to loop until something happens

Syntax

until condition
do
  statements
done

Examples

  • Loop until bpillet logs in, and when he does ring the bell
until who | grep "$1" > /dev/null
do
  sleep 60
done

echo -e \\a
echo "*** $1 has just logged in ***"