Search code examples
awkschedulingpolicyps

Scheduling Policy and processes


I want to print for all my running processes and not just a specific one the result of this command :

chrt -p PID

i have tried this but didn't work :

x=$(ps -e | awk '{print $1}')`
chrt -p x

I would appreciate any help.


Solution

  • You have to use a looping construct to perform task for all running processes:-

    ps -eo pid | while read pid; do print "chrt -p $pid"; done
    

    Remove the print and rerun, if output looks good.