-
-
Save elcascarudo-dev/bf79241e49d0ec6da017752f42805cd9 to your computer and use it in GitHub Desktop.
For linea de comando Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Estructura | |
for [variable] in [lista a recorrer]; do [comandos a ejecutar]; done | |
# Ejemplo | |
-- Listo los elementos que devuelve el "ls" | |
for x in $(ls); do echo $x; done | |
-- Defijo si es archivo o directorio lo que devuelve el "ls" | |
for x in $(ls); do if [[ -f $x ]]; then echo "Archivo -> $x"; else echo "Directorio -> $x"; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment