mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
fix: network/sockets command (#978)
This commit is contained in:
parent
96c7e61141
commit
58f8c75688
1 changed files with 2 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
export def sockets [--abbreviate-java-class-paths (-j)] {
|
export def main [--abbreviate-java-class-paths (-j)] {
|
||||||
let input = (^lsof +c 0xFFFF -i -n -P)
|
let input = (^lsof +c 0xFFFF -i -n -P)
|
||||||
let header = ($input | lines
|
let header = ($input | lines
|
||||||
| take 1
|
| take 1
|
||||||
|
@ -12,7 +12,7 @@ export def sockets [--abbreviate-java-class-paths (-j)] {
|
||||||
| upsert 'pid' { |r| $r.pid | into int }
|
| upsert 'pid' { |r| $r.pid | into int }
|
||||||
| rename --column { name: connection }
|
| rename --column { name: connection }
|
||||||
| reject 'command'
|
| reject 'command'
|
||||||
| join-table (ps -l) 'pid' 'pid'
|
| join (ps -l) 'pid' 'pid'
|
||||||
| if $abbreviate_java_class_paths {
|
| if $abbreviate_java_class_paths {
|
||||||
upsert 'classpath' { |r| $r.command | java-cmd classpath }
|
upsert 'classpath' { |r| $r.command | java-cmd classpath }
|
||||||
| upsert 'command' { |r| $r.command | java-cmd abbreviate-classpath }
|
| upsert 'command' { |r| $r.command | java-cmd abbreviate-classpath }
|
||||||
|
@ -26,7 +26,3 @@ export def 'java-cmd classpath' [] {
|
||||||
export def 'java-cmd abbreviate-classpath' [] {
|
export def 'java-cmd abbreviate-classpath' [] {
|
||||||
str replace '[^ ]*\.jar' '*.jar'
|
str replace '[^ ]*\.jar' '*.jar'
|
||||||
}
|
}
|
||||||
|
|
||||||
export def join-table [table: table, left_on: string, right_on: string] {
|
|
||||||
dfr into df | join ($table | dfr into df) $left_on $right_on | dfr into nu
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue