mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-02-28 10:38:12 +00:00
Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
This commit is contained in:
25
dot_config/nushell/nu_scripts/sourced/examples/netstat.nu
Normal file
25
dot_config/nushell/nu_scripts/sourced/examples/netstat.nu
Normal file
@@ -0,0 +1,25 @@
|
||||
let ns = (netstat | lines | skip 1)
|
||||
|
||||
let first_batch = ($ns | take until {|it| $it =~ Active } | str join (char nl) | from ssv -m 1)
|
||||
let second_batch = ($ns |
|
||||
skip until {|it| $it =~ Active } |
|
||||
skip 1 |
|
||||
str join (char nl) |
|
||||
str replace '\[ \]' "[]" --all |
|
||||
from ssv -m 1 |
|
||||
default I-Node "" |
|
||||
default Path ""
|
||||
| each {|row| if $row.Type == DGRAM {
|
||||
$row | update Path { get I-Node } | update I-Node { get State } | update State ""
|
||||
} else {
|
||||
$row
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
print $first_batch
|
||||
print $second_batch
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user