mkshelf.sh

来自「linux 内核源代码」· Shell 代码 · 共 29 行

SH
29
字号
#! /bin/shif test "$#" != "2"; then	echo "Usage: sh `basename $0` {dir} {shelfaddress}" 1>&2	echo "       n_partitions=16 sh `basename $0` {dir} {shelfaddress}" 1>&2	exit 1fin_partitions=${n_partitions:-16}dir=$1shelf=$2nslots=16maxslot=`echo $nslots 1 - p | dc`MAJOR=152set -eminor=`echo $nslots \* $shelf \* $n_partitions | bc`endp=`echo $n_partitions - 1 | bc`for slot in `seq 0 $maxslot`; do	for part in `seq 0 $endp`; do		name=e$shelf.$slot		test "$part" != "0" && name=${name}p$part		rm -f $dir/$name		mknod -m 0660 $dir/$name b $MAJOR $minor		minor=`expr $minor + 1`	donedone

⌨️ 快捷键说明

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