vault backup: 2025-12-12 15:22:45

This commit is contained in:
2025-12-12 15:22:45 +01:00
parent be701009ba
commit ed446a8469
5 changed files with 70 additions and 17 deletions

View File

@@ -33,9 +33,48 @@ if ! grep -q "hola" archivos.txt; then
fi
```
---
## `case...in...esac`
```Shell
case $option in
start) echo "iniciando";;
stop) echo "Finalizando";;
*) echo "Opción no válida";;
esac
```
---
## `for, in, do, done` (Bucles)
```Shell
for i in 1 2 3; do
echo "numero $i"
done
```
---
## `while, until` (Bucles condicionales)
```Shell
while [[ "$x" -lt 5 ]]; do
echo $x
((x++))
done
```
```Shell
until [[ "$x" -eq 5 ]]; do
echo $x
((x++))
done
```
---
## `select` (Menú interactivo)
```Shell
select opcion in Start Stop Exit; do
echo "Elegiste la opcion $opcion"
done
```

View File

@@ -69,3 +69,7 @@ Bibliografía Web:
- [Manejo de errores en Bash Scripting](https://adictosalinux.com/manejo-errores-scripts-bash/)
- [Comparator operators](https://www.tutorialkart.com/bash-shell-scripting/bash-comparison-operators/)
- [Funciones Bash](https://itsfoss.com/es/funciones-bash/)
---
# Validador de contraseñas