24、实用脚本与 OS X 系统技巧
2026/5/4 15:39:42 网站建设 项目流程

实用脚本与 OS X 系统技巧

1. renicename 脚本

renicename 脚本的主要功能是对匹配指定名称的作业进行优先级调整。以下是该脚本的代码:

#!/bin/bash # renicename--Renices the job that matches the specified name user=""; tty=""; showpid=0; niceval="+1" # Initialize while getopts "n:u:t:p" opt; do case $opt in n ) niceval="$OPTARG"; ;; u ) if [ ! -z "$tty" ] ; then echo "$0: error: -u and -t are mutually exclusive." >&2 exit 1 fi user=$OPTARG ;; t ) if [ ! -z "$user" ] ; then echo "$0: error: -u and -t are mutually exclusive." >&2 exit 1 fi tty=$OPTARG ;; p ) showpid=1; ;; ? ) echo "Usage: $0 [-n niceval] [-u

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询