[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previaPróxima revisiónAmbos lados, revisión siguiente | ||
es:howtos:general_admin:cli_constructs_and_useful_info [2019/02/07 16:01 (UTC)] – [Construye] slackwarespanol | es:howtos:general_admin:cli_constructs_and_useful_info [2019/02/07 19:26 (UTC)] – [Cita] slackwarespanol | ||
---|---|---|---|
Línea 1: | Línea 1: | ||
<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | ||
<note warning> | <note warning> | ||
- | ====== Construcciones de CLI e información útil ====== | + | ====== Construcciones de CLI (Interfaz de línea de comandos) |
El propósito de este artículo no es ser un tutorial de CLI, sino más bien ser una exposición de construcciones comunes utilizadas en shell scripting para lograr un objetivo de manera eficiente. También hay secciones que simplemente ayudan a entender un tema determinado. | El propósito de este artículo no es ser un tutorial de CLI, sino más bien ser una exposición de construcciones comunes utilizadas en shell scripting para lograr un objetivo de manera eficiente. También hay secciones que simplemente ayudan a entender un tema determinado. | ||
==== Construye ==== | ==== Construye ==== | ||
Línea 37: | Línea 37: | ||
column three contains lines common to both files. | column three contains lines common to both files. | ||
</ | </ | ||
- | Las opciones '' | + | Las opciones |
<code bash> | <code bash> | ||
# before, make install, after | # before, make install, after | ||
Línea 55: | Línea 55: | ||
=== while read line === | === while read line === | ||
- | This construct is common and is useful for reading files or stdin one line at a time. Here is an example that can be used to concatenate split files in order: | + | Esta construcción es común y es útil para leer archivos o ingresar una línea |
<code bash> | <code bash> | ||
base=" | base=" | ||
Línea 64: | Línea 64: | ||
done | done | ||
</ | </ | ||
- | Also note that '' | + | También tenga en cuenta que '' |
=== for i in === | === for i in === | ||
- | Here is an example for extracting all rpms in a directory: | + | Aquí hay un ejemplo para extraer todos los rpms en un directorio: |
<code bash> | <code bash> | ||
for i in *.rpm | for i in *.rpm | ||
Línea 73: | Línea 73: | ||
done | done | ||
</ | </ | ||
- | You can also use '' | + | También puede usar '' |
<code bash> | <code bash> | ||
for i in $(seq 1 100) | for i in $(seq 1 100) | ||
Línea 80: | Línea 80: | ||
done | done | ||
</ | </ | ||
- | Note that there are no quotes around | + | Tenga en cuenta que no hay comillas alrededor de '' |
- | == External Links === | + | == Enlaces externos |
- | * http:// | + | |
- | ==== Quoting | + | ==== Comilla |
- | Quoting may seem complicated, and reasons for it obscure, but there is a purpose to it and it is not that complicated. | + | |
- | === Double quoting | + | |
- | The reason for double quoting is to preserve spaces, like spaces in file names. Double quoting a variable | + | |
<code bash> | <code bash> | ||
bash-4.2$ ls | bash-4.2$ ls |