Plan 9 from Bell Labs’s /usr/web/sources/contrib/someone/root/rc/bin/kern

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# kern - print path name of running kernel
rfork e

cpu= `{echo $terminal | sed 's; .*;;' | tr A-Z a-z}
if (~ $cpu generic _MP_ _mp_)
	cpu=386
if (! ~ $cpu $cputype) {
	echo $0: implausible cpu $cpu for cputype $cputype >[1=2]
	cpu=$cputype
}
tbase=`{echo $terminal | sed 's/.* //'}
base=`{basename $tbase}
if (test -e  /$cpu/s9^$base)
	echo /$cpu/s9^$base
if not
	echo /$cpu/9^$base

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.