#Bash
Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]
Edit: It works the same way Soham's does. It turns all non numeric characters in the output of top into '+' and then evaulates the parity of the resulting string.
the 'b' flag to top runs it in batch mode so that it reports all processes, not just the first screenful and 'n1' says to just run 1 iteration of top.
#Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]
Edit: It works the same way Soham's does. It turns all non numeric characters in the output of top into '+' and then evaulates the parity of the resulting string.
the 'b' flag to top runs it in batch mode so that it reports all processes, not just the first screenful and 'n1' says to just run 1 iteration of top.
Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]
Edit: It works the same way Soham's does. It turns all non numeric characters in the output of top into '+' and then evaulates the parity of the resulting string.
the 'b' flag to top runs it in batch mode so that it reports all processes, not just the first screenful and 'n1' says to just run 1 iteration of top.
#Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]
Edit: It works the same way Soham's does. It turns all non numeric characters in the output of top into '+' and then evaulates the parity of the resulting string.
the 'b' flag to top runs it in batch mode so that it reports all processes, not just the first screenful and 'n1' says to just run 1 iteration of top.
#Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]
#Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]
Edit: It works the same way Soham's does. It turns all non numeric characters in the output of top into '+' and then evaulates the parity of the resulting string.
the 'b' flag to top runs it in batch mode so that it reports all processes, not just the first screenful and 'n1' says to just run 1 iteration of top.
##Bash#Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]
##Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]
#Bash
I took Soham’s own suggestion (using top):
echo $[`top -bn1|sed 's/[^1-9]/+/g'`0&1]