nice

来自「实战Linux编程的原代码,希望对学驱动的人能有所帮助」· 代码 · 共 71 行

TXT
71
字号
#! /bin/sh# This script takes no arguments.if test -n "$DJDIR"; then  echo "$0: cannot test nice on DJGPP" >&2  exit 77fitests='0 empty 101 -1 12 -12 123 -1:-2 24 -n:1 15 -n:1:-2 26 -n:1:-+12 127 -2:-n:1 18 -2:-n:12 129 -+1 110 -+12 1211 -+1:-+12 1212 -n:+1 113 --1:-2 214 --1:-2:-13 1315 --1:-n:2 216 --1:-n:2:-3 317 --1:-n:2:-13 1318 -n:-1:-12 1219 --1:-12 12NA LAST NA'set - $testsif test "$VERBOSE" = yes; then  nice --version  set -xfi_POSIX2_VERSION=199209export _POSIX2_VERSION# Require that this test be run at `nice' level 0.niceness=`nice`if test "$niceness" = 0; then    : okelse  echo "$0: this test must be run at nice level 0" 1>&2  exit 77fifail=0while :; do  test_name=$1  args=$2  expected_result=$3  test $args = empty && args=''  test x$args = xLAST && break  args=`echo x$args|tr : ' '|sed 's/^x//'`  if test "$VERBOSE" = yes; then    #echo "testing \`nice $args nice\` = $expected_result ..."    echo "test $test_name... " | tr -d '\012'  fi  test x`nice $args nice 2> /dev/null` = x$expected_result \    && ok=ok || ok=FAIL fail=1  test "$VERBOSE" = yes && echo $ok  test x`nice $args nice 2> /dev/null` = x$expected_result || fail=1  shift; shift; shiftdoneexit $fail

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?