Hacker News new | past | comments | ask | show | jobs | submit login

That forks twice for every iteration of the loop, though: once for the subshell, and again to run `tr`.



Fix:

  ps() { for i in /proc/[0-9]*; do readarray -d '' -t cmdline < "$i/cmdline"; printf "%s: %s\n" "${i#/proc/}" "${cmdline[*]}"; done; }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: