|
|
Plan 9 NeXT
#!/bin/rc
if(! ~ $#* 1){
echo usage: mkdevlist file >[2=1]
exit 1
}
fn mkextract{
sed '/^$/d; /^#/d' $2 | awk '
BEGIN { doprint=0 }
doprint && /^[^ ]/ { doprint=0 }
doprint { print "dev" $1 "'.$O'"; for(i=3; i <= NF; i++)
print $i "'.$O'"; }
$0 ~ field { doprint=1; next }
' 'field=^'$1
}
mkextract dev $1
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.