Skip to content

Commit 202567b

Browse files
committed
Update docs for sys deprecation
1 parent d0bdc1d commit 202567b

13 files changed

+37
-114
lines changed

book/coming_from_bash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Note: this table assumes Nu 0.91.0 or later.
4949
| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second |
5050
| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command |
5151
| `echo /tmp/$RANDOM` | `$"/tmp/(random integer)"` | Use command output in a string |
52-
| `cargo b --jobs=$(nproc)` | `cargo b $"--jobs=(sys \| get cpu \| length)"` | Use command output in an option |
52+
| `cargo b --jobs=$(nproc)` | `cargo b $"--jobs=(sys cpu \| length)"` | Use command output in an option |
5353
| `echo $PATH` | `$env.PATH` (Non-Windows) or `$env.Path` (Windows) | See the current path |
5454
| `<update ~/.bashrc>` | `vim $nu.config-path` | Update PATH permanently |
5555
| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | Update PATH temporarily |

book/introduction.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

book/nushell_map.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The idea behind this table is to help you understand how Nu builtins and plugins relate to other known shells and domain specific languages. We've tried to produce a map of relevant Nu commands and what their equivalents are in other languages. Contributions are welcome.
44

5-
Note: this table assumes Nu 0.43 or later.
5+
Note: this table assumes Nu 0.94 or later.
66

77

88
| Nushell | SQL | .Net LINQ (C#) | PowerShell (without external modules) | Bash |
@@ -59,7 +59,9 @@ Note: this table assumes Nu 0.43 or later.
5959
| str join | concat_ws | Join | Join-String | |
6060
| str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | |
6161
| sum | sum | Sum | Measure-Object, measure | |
62-
| sys | | | Get-ComputerInfo | uname, lshw, lsblk, lscpu, lsusb, hdparam, free |
62+
| sys host | | | Get-ComputerInfo | uname |
63+
| sys disks | | | Get-ComputerInfo | lsblk |
64+
| sys mem | | | Get-ComputerInfo | free |
6365
| table | | | Format-Table, ft, Format-List, fl | |
6466
| take | top, limit | Take | Select-Object -First | head |
6567
| take until | | TakeWhile | | |

book/nushell_map_imperative.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Note: this table assumes Nu 0.43 or later.
1616
| du | shutil.disk_usage | | | |
1717
| each | for | for | for | for |
1818
| exit | exit | System.exit, kotlin.system.exitProcess | exit | exit |
19-
| http get | urllib.request.urlopen | | | |
19+
| http get | urllib.request.urlopen | | | |
2020
| first | list[:x] | List[0], peek | vector[0], top | Vec[0] |
2121
| format | format | format | format | format! |
2222
| from | csv, json, sqlite3 | | | |
@@ -32,7 +32,7 @@ Note: this table assumes Nu 0.43 or later.
3232
| kill | os.kill | | | |
3333
| last | list[-x:] | | | &Vec[Vec.len()-1] |
3434
| lines | split, splitlines | split | views::split | split, split_whitespace, rsplit, lines |
35-
| ls | os.listdir | | | fs::read_dir |
35+
| ls | os.listdir | | | fs::read_dir |
3636
| match | match | when | | match |
3737
| merge | dict.append | | | map.extend |
3838
| mkdir | os.mkdir | | | fs::create_dir |
@@ -57,20 +57,19 @@ Note: this table assumes Nu 0.43 or later.
5757
| size | len | | | len |
5858
| skip | list[x:] | | | &Vec[x..],skip |
5959
| skip until | itertools.dropwhile | | | |
60-
| skip while | itertools.dropwhile | | | skip_while |
60+
| skip while | itertools.dropwhile | | | skip_while |
6161
| sort-by | sorted, list.sort | sortedBy, sortedWith, Arrays.sort, Collections.sort | sort | sort |
6262
| split row | str.split{,lines}, re.split | split | views::split | split |
6363
| str | str functions | String functions | string functions | &str, String functions |
6464
| str join | str.join | joinToString | | join |
6565
| str trim | strip, rstrip, lstrip | trim, trimStart, trimEnd | regex | trim, trim*{start,end}, strip*{suffix,prefix} |
6666
| sum | sum | sum | reduce | sum |
67-
| sys | sys | | | |
6867
| to | import csv, json, sqlite3 | | | |
6968
| touch | open(path, 'a').close() | | | |
7069
| uniq | set | Set | set | HashSet |
7170
| upsert | dict[\"key\"] = val | | | |
7271
| version | sys.version, sys.version_info | | | |
7372
| with-env | os.environ | | | |
74-
| where | filter | filter | filter | filter |
73+
| where | filter | filter | filter | filter |
7574
| which | shutil.which | | | |
7675
| wrap | { "key" : val } | | | |

book/operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ operator. You can use the spread multiple records inside a single record literal
211211
...$config,
212212
users: [alice bob],
213213
...{ url: example.com },
214-
...(sys | get mem)
214+
...(sys mem)
215215
}
216216
╭────────────┬───────────────╮
217217
│ path │ /tmp │

book/quick_tour.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ To get the date as a table we can feed it into [`date to-table`](/commands/docs/
3838

3939
@[code](@snippets/introduction/date_table_example.sh)
4040

41-
Running [`sys`](/commands/docs/sys.md) gives information about the system that Nu is running on:
41+
Running [`sys host`](/commands/docs/sys_host.md) gives information about the system that Nu is running on:
4242

43-
@[code](@snippets/introduction/sys_example.sh)
43+
@[code](@snippets/introduction/sys_host_example.sh)
4444

45-
This is a bit different than the tables we saw before. The [`sys`](/commands/docs/sys.md) 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:
45+
This is a bit different than the tables we saw before. The [`sys host`](/commands/docs/sys.md) command gives us a [record](/book/types_of_data.html#records), which is set of key-value pairs. Note that the "sessions" column in the record happens to contain a table instead of a simple value. To take a look at this data, we need to _get_ the column to view:
4646

4747
@[code](@snippets/introduction/sys_get_example.sh)
4848

49-
The [`get`](/commands/docs/get.md) 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:
49+
The [`get`](/commands/docs/get.md) command lets us jump into the contents of structured data (a table, record, or list). Here, we're looking into the "sessions" column, which contains a table of the users on the system and their groups. Let's get the names of the users:
5050

5151
@[code](@snippets/introduction/sys_get_nested_example.sh)
5252

53-
Right now, there's just one user on the system named "sophiajt". You'll notice that we can pass a column path (the `host.sessions.name` 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.
53+
Right now, there's just one user on the system named "sophiajt". You'll notice that we can pass nested columns (the `sessions.name` part) and not just the name of the column. These are called [cell paths](/book/types_of_data.html#cell-paths). Nu will take the cell path and go to the corresponding bit of data in the table.
5454

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

0 commit comments

Comments
 (0)