summaryrefslogtreecommitdiff
path: root/sysfiles.sh
blob: 54229d8857b602dae603d56bf6323a0be9ab6d43 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

cputime_file=${TMPDIR-/tmp}/cputime

mpstat -P ALL 1 > "$cputime_file" &

while true; do
	cputime="`tail -n4 "$cputime_file"`"
	echo "$cputime">"$cputime_file"
	sleep 1
done