Created
October 12, 2016 15:33
-
-
Save cverbiest/9f5cda5a306c0fa856ebf6d46274a964 to your computer and use it in GitHub Desktop.
Linux Enhanced proshut list, add process info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Enhance proshut list, show process info for local processes, needs root access | |
# | |
proshut $1 -C list | awk '{ if (NR==1) { procinfo="process info"; } else if ($8 == "REMC" || $9=="REMC") { procinfo="remote process"; } else { procfile="/proc/"$2"/cmdline"; getline procinfo < procfile; procinfo = gensub(/\000/, " ", "g", procinfo); } print $0,procinfo ;}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment