File: limitperl

package info (click to toggle)
cpulimit 3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 176 kB
  • sloc: ansic: 1,015; makefile: 45; sh: 8
file content (10 lines) | stat: -rwxr-xr-x 231 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

set -e

LOG=cpulimit.log
rm -f $LOG

cpulimit -l 25 -f -v -- perl -e '$z=time()+10; while (time()<$z) { $i++; }' >$LOG
grep -Eq '^Process [0-9]+ detected$' $LOG
grep -Eq '^Child process is finished, exiting\.\.\.$' $LOG