diff --git a/sysmon b/sysmon index 5cf4e8c..3e5ecef 100644 --- a/sysmon +++ b/sysmon @@ -1,10 +1,13 @@ #!/bin/bash #@Author Shahriar Shovon +#vers. 1.1 Maurizio Bruccoleri (2021-11-03) - resolved issue related to truncated command field value #@Github https://github.com/shovon8/sysmon +# printf "%-10s%-15s%-15s%s\n" "PID" "OWNER" "MEMORY" "COMMAND" function sysmon_main() { - RAWIN=$(ps -o pid,user,%mem,command ax | grep -v PID | awk '/[0-9]*/{print $1 ":" $2 ":" $4}') + local IFS=$'\n' + RAWIN=$(ps -o pid,user,%mem,command ax | grep -v PID | awk '{printf $1":"$2":"}{for(i=4;i<=NF;++i)printf $i""FS ; print ""}') for i in $RAWIN do