From 57dbe35fb68dda4888fc4c9e8c8d0b3106a8a21c Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 9 Dec 2019 17:44:28 +0100 Subject: console(8): add console command and manpage the console command runs a command or the system shell under a new instance of kbdfs, optionally providing a serial console when $console environment variable is set. --- rc/bin/console | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 rc/bin/console (limited to 'rc/bin/console') diff --git a/rc/bin/console b/rc/bin/console new file mode 100755 index 000000000..87f24a726 --- /dev/null +++ b/rc/bin/console @@ -0,0 +1,16 @@ +#!/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 >[2=1]} | tee $a + exit + } +} +aux/kbdfs $a +exec $* /dev/cons >[2=1] -- cgit v1.2.3