Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,21 @@ module.exports = {
title: "Nu Libro",
collapsable: false,
children: [
"",
"instalacion",
"introduccion",
"explorando",
"tipos_de_datos",
"cargando_datos",
"cargando_datos", // "trabajando_con_listas"
"trabajando_con_tablas",
"pipeline",
"configuracion",
"aliases",
"matematicas",
"entorno",
"configuracion", // "custom_commands"
"aliases", // "operadores"
"matematicas", // "variables_y_subexpresiones"
"entorno", // "scripts"
"metadatos",
"shells_en_shells",
"escapando",
"plugins",
"plugins", // "dataframes"
"llegando_de_bash",
"mapa_nushell",
"mapa_imperativo_nushell",
Expand Down
10 changes: 5 additions & 5 deletions book/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Hello, and welcome to the Nushell project. The goal of this project is to take the Unix philosophy of shells, where pipes connect simple commands together, and bring it to the modern style of development.

Nu takes cues from a lot of familiar territory: traditional shells like bash, advanced shells like PowerShell, functional programming, systems programming, and more. But rather than trying to be the jack of all trades, Nu focuses its energy on doing a few things well:
Nu takes cues from a lot of familiar territory: traditional shells like bash, object based shells like PowerShell, functional programming, systems programming, and more. But rather than trying to be the jack of all trades, Nu focuses its energy on doing a few things well:

* Create a flexible cross-platform shell with a modern feel
* Allow you to mix and match commandline applications with a shell that understands the structure of your data
Expand Down Expand Up @@ -50,19 +50,19 @@ Running `sys` gives information about the system that Nu is running on:

<<< @/snippets/introduction/sys_example.sh

This is a bit different than the tables we saw before. The `sys` command gives us a table that contains structured tables in the cells instead of simple values. To take a look at this data, we need to get the column to view:
This is a bit different than the tables we saw before. The `sys` command gives us a table that contains structured tables in the cells instead of simple values. To take a look at this data, we need to *get* the column to view:

<<< @/snippets/introduction/sys_get_example.sh

The `get` command lets us jump into the contents of a column of the table. Here, we're looking into the "host" column, which contains information about the host that Nu is running on. The name of the OS, the hostname, the CPU, and more. Let's get the name of the users on the system:

<<< @/snippets/introduction/sys_get_nested_example.sh

Right now, there's just one user on the system named "jonathan". You'll notice that we can pass a column path (the `host.sessions` part) and not just the name of the column. Nu will take the column path and go to the corresponding bit of data in the table.
Right now, there's just one user on the system named "jt". You'll notice that we can pass a column path (the `host.sessions` part) and not just the name of the column. Nu will take the column path and go to the corresponding bit of data in the table.

You might have noticed something else that's different. Rather than having a table of data, we have just a single element: the string "jonathan". Nu works with both tables of data as well as strings. Strings are an important part of working with commands outside of Nu.
You might have noticed something else that's different. Rather than having a table of data, we have just a single element: the string "jt". Nu works with both tables of data as well as strings. Strings are an important part of working with commands outside of Nu.

Let's see how strings work outside of Nu in action. We'll take our example from before and run the external `echo` command (the `^` tells nu to not use the built-in `echo` command):
Let's see how strings work outside of Nu in action. We'll take our example from before and run the external `echo` command (the `^` tells Nu to not use the built-in `echo` command):

<<< @/snippets/introduction/sys_get_external_echo_example.sh

Expand Down
2 changes: 1 addition & 1 deletion es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ $ scoop install nu

```
$ nu
```
```
97 changes: 73 additions & 24 deletions es/book/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,73 @@
# Índice

* [Instalación](instalacion.md) - Instalando nushell
* [Introducción](introduccion.md) - Empezando
* [Explorando](explorando.md) - Explorando en nushell
* [Tipos de datos](tipos_de_datos.md) - Tipos de datos en nushell
* [Cargando datos](cargando_datos.md) - Cargando datos y usándola
* [Trabajando con tablas](trabajando_con_tablas.md) - Trabajando con tablas nushell
* [Pipeline](pipeline.md) - Cómo funciona el pipeline
* [Configuración](configuracion.md) - Cómo configurar nushell
* [Aliases](aliases.md) - Aliases para bloques de comandos
* [Matemáticas](matematicas.md) - Operaciones matemáticas en nushell
- [Variables y subexpresiones](variables_y_subexpresiones.md) - Trabajando con variables y subexpresiones
* [Entorno](entorno.md) - Trabajando con variables de entorno
* [Metadatos](metadatos.md) - Una explicación del sistema de metadatos en nushell
* [Shells](shells_en_shells.md) - Trabajando con múltiples ubicaciones
* [Escapando commandos](escapando.md) - Escapando a comandos nativos de mismo nombre
* [Plugins](plugins.md) - Mejorando nushell con más funcionalidades usando complementos
* [Llegando de Bash](llegando_de_bash.md) - Guía para aquellos llegando a nushell desde bash
* [Mapa Nushell de shells/DSLs](mapa_nushell.md) - Guía de ayuda para comprender como nushell se compara con SQL, Linq, PowerShell y Bash
* [Mapa Nushell de lenguajes imperativos](mapa_imperativo_nushell.md) - Guía de ayuda para comprender como nushell se compara con Python, Kotlin, C++, C# y Rust
* [Mapa Nushell de lenguajes funcionales](mapa_funcional_nushell.md) - Guía de ayuda para comprender como nushell se compara con Clojure, Tablecloth (Ocaml / Elm), y Haskell
* [Mapa Nushell de operadores](mapa_nushell_operador_map.md) - Guía para ayudar a entender los operadores
* [Command Reference](command_reference.md) - A list of all Nushell's commands.
# Introducción

Hola, y bienvenido al proyecto Nushell. El objetivo de este proyecto es tomar la filosofía Unix de shells, dónde tuberías *-pipes-* conectan comandos simples juntos y llevarlos al estilo moderno de desarrollo.

Nu toma ideas de muchos territorios familiares: shells tradicionales como bash, shells basadas en objetos como PowerShell, programación funcional, programación de sistemas, y más. Pero, en lugar de ser un "Todo en uno", No enfoca su energía en hacer algunas cosas bien:

* Crear una multiplataforma shell flexible con un toque moderno.
* Permitir mezclar y combinar aplicaciones de línea de comandos con una shell que entiende la estructura de sus datos.
* Tenga el brillo UX que proporcionan las aplicaciones modernas CLI.

La manera más facil de ver qué puede hacer Nu es con ejemplos, iniciemos.

Lo primero que notarás al ejercutar un comando como `ls` es que en lugar de un bloque de texto que regresa, recibirás una tabla estructurada.

<<< @/snippets/introduction/ls_example.sh

La tabla no solamente muestra lo que hay en el directorio de una manera distinta sino algo más. Como las tablas de una hoja de cálculo *-*spreadsheet*-*, esta tabla te permite trabajar con los datos más interactivamente.

Lo primero que vamos hacer es ordenar nuestra tabla por tamaño. Para poder hacerlo tomaremos la salida de `ls` y la alimentaremos al comando que ordena tablas basado en los valores de una columna (para este ejemplo sería la columna `size`).

<<< @/snippets/introduction/ls_sort_by_reverse_example.sh

Puedes observar que para lograrlo no tuvimos que pasar argumentos al comando `ls`. En cambio, nosotros usamos el comando `sort-by` que proporciona Nu para ordenar la salida del comando `ls`. Para ver los archivos más grandes en las primeras filas usamos el comando `reverse`.

Nu proporciona muchos comandos que trabajan con tablas. Por ejemplo, podemos filtrar los contenidos de la tabla de `ls` para únicamente mostrar archivos superiores a 1 kilobytes:

<<< @/snippets/introduction/ls_where_example.sh

Al igual que en la filosofía Unix, poder hacer que los comandos hablen entre ellos nos da maneras de mezclar y combinar de formas distintas. Miremos otro ejemplo:

<<< @/snippets/introduction/ps_example.sh

Es posible que estés familiarizado con el comando `ps` si has utilizado Linux. Con dicho comando, podemos tener una lista de los procesos actuales que ejecuta el sistema, qué estado tienen y sus nombres. También podemos ver la carga CPU del proceso.

¿Qué tal si quisiéramos mostrar los procesos que activamente usan el CPU? Así como hicimos con el comando `ls` previamente, también podemos trabajar con la tabla que nos devuelve `ps`:

<<< @/snippets/introduction/ps_where_example.sh

Hasta ahora, hemos visto el uso de `ls` y `ps` para enumerar archivos y procesos. Nu también ofrece otros comandos que pueden crear tablas con información de gran utilidad. Exploremos `date` y `sys`.

Ejecutando `date now` nos proporciona información del día y tiempo:

<<< @/snippets/introduction/date_example.sh

Para obtener una tabla podemos alimentar la salida a `date to-table`

<<< @/snippets/introduction/date_table_example.sh

Ejecutando `sys` devuelve información sobre el sistema en el que se ejecuta Nu:

<<< @/snippets/introduction/sys_example.sh

Esta tabla se ve un poco diferente con las que ya hemos trabajado. El comando `sys` nos regresa una tabla que también contiene tablas estructuradas en las celdas en vez de valores simples. Para explorar esos datos, necesitamos *obtener* la columna deseada para mostrar:

<<< @/snippets/introduction/sys_get_example.sh

El comando `get` nos permite ir directo al valor de una columa de la tabla. Aquí estamos mirando la columna "host" que contiene información del host dónde se está ejecutando Nu. El nombre del sistema operativo, hostname, CPU, y más. Miremos los nombres de los usuarios en el sistema:

<<< @/snippets/introduction/sys_get_nested_example.sh

En este momento, solo hay un usuario en el sistema llamado "jt". Notarás que podemos pasar una ruta de columna *-*column path*-* y no únicamente el nombre de una columna. Nu tomará esta ruta de columna e irá a los datos correspondientes en la tabla.

Es posible que hayas notado algo más diferente también. En lugar de tener una tabla de datos, tenemos solo un elemento individual: la cadena "jt". Nu trabaja tanto con tabla de datos así como cadenas. Cadenas son una parte importante de trabajar con comandos fuera de Nu.

Miremos en acción cómo funcionan las cadenas fuera de Nu. Tomaremos el ejemplo anterior y ejecutaremos el comando externo `echo` (el carácter `^` le informa a Nu que no se desea usar el comando *interno* también llamado `echo`):

<<< @/snippets/introduction/sys_get_external_echo_example.sh

Si esto se parece mucho a lo que teníamos antes, ¡tienes buen ojo! Es similar, pero con una diferencia importante: hemos llamado `echo` con el valor que vimos antes. Esto nos permite pasar datos fuera de Nu a `echo` (o cualquier comando fuera de Nu, como `git` por ejemplo)

*Nota: Para texto de ayuda de los comandos internos de Nu, puedes descubrirlos con el comando `help`*:

<<< @/snippets/introduction/help_example.sh
Loading