Plan 9 from Bell Labs’s /usr/web/sources/contrib/quanstro/root/rc/bin/hdtemp

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


#!/bin/rc
rfork e

fn az{
	atazz $* >[2]/dev/null
}

fn aze{
	echo $*(2-) | atazz $1 >[2]/dev/null
}

fn devs{
	d0=`{echo probe | az | sed 's/[ 	].*//g'}
	d=()
	for(i in $d0)
		if(aze $i dev | grep -s '^flags.*[ 	]sct')
			d = ($d $i)
}

flagfmt=''
args='dev'
if(! ifs=() eval `{aux/getflags $*}){
	aux/usage
	exit usage
}

if(~ $#* 0)
	devs
if not
	d = $*

for(i in $d){
	t=`{aze $i read log ext sctstat | grep '^temp'}
	if(! ~ $status '' || ! ~ $#t 2)
		t = (temp unknown)
	echo $i^'	'^$t(2)
}

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.