shithub: riscv

ref: e94d21ee3a2d7d053899d490b115ba763d0a1bc2
dir: /rc/bin/chdev/

View raw version
#!/bin/rc
rfork e

fn usage {
	echo 'usage:' $0 '[ -nr ] devmask' >[1=2]
	exit usage
}

op='&'
while(~ $1 -*){
	switch($1){
	case -n; op='~'
	case -r; op='&~'
	case *; usage
	}
	shift
}

echo chdev $op $1 >> '#c/drivers'