escape \ in process argument

`ps` uses \ in the COMMAND column when a `wine` process is running
pull/111/head
Thomas Andres 2020-05-09 23:18:36 +02:00 committed by GitHub
parent 9a717a1420
commit 0a064f97c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1711,7 +1711,7 @@ collect_processes() { #? Collect process information and calculate accurate cpu
options="-t"
fi
readarray ${options} proc_array < <(ps ax${tree:+f} -o pid:${proc[pid_len]}=Pid:,comm:${format_cmd}=${tree:-Program:}${format_args},nlwp:3=Tr:,euser:6=User:,pmem=Mem%,pcpu:10=Cpu% --sort ${proc[reverse]:--}${sort})
readarray ${options} proc_array < <(ps ax${tree:+f} -o pid:${proc[pid_len]}=Pid:,comm:${format_cmd}=${tree:-Program:}${format_args},nlwp:3=Tr:,euser:6=User:,pmem=Mem%,pcpu:10=Cpu% --sort ${proc[reverse]:--}${sort} | sed 's.\\.\\\\.g')
proc_array[0]="${proc_array[0]/ Tr:/ Threads:}"
proc_array[0]="${proc_array[0]/ ${selected}/${symbol}${selected}}"