Answer the question
In order to leave comments, you need to log in
How to compare values in output lines and conditionally execute a script?
I display the temperature values of the processor with the command:
sensors | grep "Core *" | awk '{print int($3)}'
At the output:
37
39
38
36
Answer the question
In order to leave comments, you need to log in
For example, so
sensors | grep "Core *" | awk '{print int($3)}' | xargs -L 1 -i bash -c "[ {} -gt 37 ] && echo '{} больше 37'"
sensors | grep "Core *" | awk '{print int($3)}' | xargs -L 1 -i bash -c "[ {} -gt 60 ] && ./too_hot.sh'"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question