if break bash

PHOTO EMBED

Thu Oct 20 2022 17:11:55 GMT+0000 (Coordinated Universal Time)

Saved by @luisjdominguezp #bash

i=0

while [ $i -lt 5 ]
do
  echo "Number: $i"
  ((i++))
  if [[ "$i" == '2' ]]; then
    break
  fi
done

echo 'All Done!'
content_copyCOPY