Advertisement
Sergio_Istea

while.sh

May 17th, 2021
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. i=0
  4.  
  5. echo "esto se ejecuta antes del bucle"
  6.  
  7. while [ $i -lt 10 ]; do
  8.  
  9. ((i++))
  10.  
  11. if [ $i -eq 4 ]; then
  12. #break
  13. # en este punto al leer el "continue" vuelve a iniciarse el bucle
  14. echo "la instrucción 'echo \"\$i = \$i\" no se va a ejecutar, todo lo que venga
  15. a continuacion dentro del bucle se salta"
  16. continue
  17. fi
  18. # por lo tanto esto no se ejecuta
  19. echo "\$i = $i"
  20.  
  21. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement