'How can I only get the boolean value from the return of sysctl, MacOS

I am trying to get the return Boolean value of the command: sysctl debug.lowpri_throttle_enabled, in a shell script (run with zsh).

This command is for knowing whether macOS enables the limit of speed of low-order tasks (i.e. time machine).

Here is the script I have done now:

value=$(sysctl debug.lowpri_throttle_enabled)
echo $value

The output I got is:

>>>debug.lowpri_throttle_enabled: 0

But I just want 0/1 as output, how can I just get the boolean value but not the whole string? Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source