3 ms·
That forks twice for every iteration of the loop, though: once for the subshell, and again to run `tr`.
by kelnos 2y ago
That forks twice for every iteration of the loop, though: once for the subshell, and again to run `tr`.
- hddqsb 2y agoFix: ps() { for i in /proc/[0-9]*; do readarray -d '' -t cmdline < "$i/cmdline"; printf "%s: %s\n" "${i#/proc/}" "${cmdline[*]}"; done; }