vault backup: 2025-12-11 01:42:15

This commit is contained in:
2025-12-11 01:42:15 +01:00
parent 8d2c3cdc66
commit 717066ff88
5 changed files with 165 additions and 93 deletions

View File

@@ -2,3 +2,40 @@
Proveniente de [[Mecánica Unix - Manejo de la shell]]
---
## Control de flujo
---
### Condicionales `if`, `elif`, `else` y `fi`
```Shell
if [[ "$num" -gt 10 ]]; then
echo "Mayor que 10"
elif [[ "$num" -eq 10 ]]; then
echo "Es 10"
else
echo "Es menor que 10"
fi
```
---
### `[[ . . . ]]`
```Shell
if [[ "$x" == "hola" && -n "$x" ]]; then
echo "coincide"
fi
```
---
### `!` (negación)
``` Shell
if ! grep -q "hola" archivos.txt; then
echo "no existe hola"
fi
```