Fix parsing exe paths containing slashes
authorSiraaj Khandkar <siraaj@khandkar.net>
Wed, 22 Sep 2021 20:10:27 +0000 (16:10 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Wed, 22 Sep 2021 20:10:27 +0000 (16:10 -0400)
home/lib/login_functions.sh

index 4ed67ba..a7bcf45 100644 (file)
@@ -670,7 +670,7 @@ status() {
     printf '%sTCP: ' "${indent_unit}${indent_unit}"
     sudo -n netstat -tnp \
     | awk 'NR > 2 && $6 == "ESTABLISHED" {print $7}' \
-    | awk -F/ '{print $2}' \
+    | awk '{sub("^[0-9]+/", ""); print}' \
     | sort -u \
     | xargs \
     | column -t
This page took 0.037361 seconds and 4 git commands to generate.