projects
/
clearscm.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Rsync Mikey & Kent
[clearscm.git]
/
clients
/
HP
/
bin
/
cpucount
1
#!/usr/bin/ksh
2
3
cpus=1
4
5
top -d 1 > /tmp/jwhzxz
6
7
grep -q "\[B 1" /tmp/jwhzxz
8
if [ $? -eq 0 ]; then
9
cpus=2
10
else
11
grep -q "\[B 2" /tmp/jwhzxz
12
if [ $? -eq 0 ]; then
13
cpus=3
14
else
15
grep -q "\[B 3" /tmp/jwhzxz
16
if [ $? -eq 0 ]; then
17
cpus=4
18
else
19
grep -q "\[B 4" /tmp/jwhzxz
20
if [ $? -eq 0 ]; then
21
cpus=5
22
else
23
grep -q "\[B 5" /tmp/jwhzxz
24
if [ $? -eq 0 ]; then
25
cpus=6
26
fi
27
fi
28
fi
29
fi
30
fi
31
32
rm /tmp/jwhzxz
33
34
echo $cpus