>_ IzzyLab

Topic breakdown

The task boils down to counting processes with a specific name. pgrep can do more than print PIDs: the -c flag outputs their count instead of a list, and -x requires an exact match of the whole process name rather than a substring occurrence — this matters so you don't catch something extra like sleepd. The same result comes from a pipeline of ps (output only the command name via -o comm=) and grep -c with line anchors.

What's checked

  1. sleep process count is correct

What it looks like