shithub: riscv

ref: bb2357de0cf04c6d8f41e7f7f72f1c033181d4e7
dir: /rc/bin/console/

View raw version
#!/bin/rc

if(~ $#* 0)
	*=(rc -i)

a=$console(1)
if(! ~ $#a 0){
	if(! ~ $a /* '#'*)
		a=/dev/eia^$a
	if(test -e /dev/kbd){
		@{rfork ns; aux/kbdfs; exec $* </dev/cons >/dev/cons >[2=1]} | tee $a
		exit
	}
}
aux/kbdfs $a
exec $* </dev/cons >/dev/cons >[2=1]