tag:blogger.com,1999:blog-8112083.post113902445759256706..comments2022-02-05T14:12:11.706-05:00Comments on inferno programmer's notebook: lab 52 - text filescaerwynhttp://www.blogger.com/profile/12819704983814002831noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-8112083.post-1160387008632577472006-10-09T05:43:00.000-04:002006-10-09T05:43:00.000-04:00an over engineered src version of src:#!/dis/sh.di...an over engineered src version of src:<BR/><BR/><BR/>#!/dis/sh.dis<BR/>fn fsrc () {<BR/> file=$"*<BR/> b=`{xd -c $file | grep '00 00 /' | sed -n 's/^/0x/; s/ .*//p' | mc}<BR/> off=`{xd -c $file | grep '00 00 /' | sed -n 's/00 00.*/00 00/p' | wc -w}<BR/> b=`{mc $b + $off -1}<BR/> e=`{xd -c $file | sed -n '$s/^/0x/p' | mc}<BR/><BR/> len=`{mc $e - $b -1}<BR/> cmd=`{ while {! ~ $len 0}{ echo -n c; len=`{mc $len - 1}} }<BR/> echo -n $file': '; mdb $1 $b^'/'^$cmd<BR/>}<BR/><BR/>for f in $* {<BR/> if {ftest -e $f}{<BR/> fsrc $f<BR/> } {ftest -e $f.dis} {<BR/> fsrc $f.dis<BR/> } {ftest -e /dis/$f} {<BR/> fsrc /dis/$f<BR/> } {ftest -e /dis/$f.dis} {<BR/> fsrc /dis/$f.dis<BR/> }{<BR/> echo src: file not found: $f<BR/> }<BR/>}saoret.onehttps://www.blogger.com/profile/00572235302918606147noreply@blogger.comtag:blogger.com,1999:blog-8112083.post-1143775692062270572006-03-30T22:28:00.000-05:002006-03-30T22:28:00.000-05:00disk/kfscmd and factotum/rpc also follow the same ...disk/kfscmd and factotum/rpc also follow the same patterncaerwynhttps://www.blogger.com/profile/12819704983814002831noreply@blogger.comtag:blogger.com,1999:blog-8112083.post-1142753570126000622006-03-19T02:32:00.000-05:002006-03-19T02:32:00.000-05:00Real applications still are preferredReal applications still are preferredAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112083.post-1141352899196824272006-03-02T21:28:00.000-05:002006-03-02T21:28:00.000-05:00abhey, nice one! i took a look at the code for csq...abhey, nice one! i took a look at the code for csquery, dnsquery, and regquery and they're all nearly the same. they should be merged into one command that can handle this pattern of interaction with fileservers. but the a shell oneliner does a fine job of it!caerwynhttps://www.blogger.com/profile/12819704983814002831noreply@blogger.comtag:blogger.com,1999:blog-8112083.post-1141229282299810912006-03-01T11:08:00.000-05:002006-03-01T11:08:00.000-05:00A simple shell replacement for dnsquery: fn dnsq {...A simple shell replacement for dnsquery: <BR/>fn dnsq {q:=$1; <> /net/dns {echo -n $q ip > [1=0];(nil nil addr):=`{read}; echo $addr}}<BR/><BR/>Obviously it doesn't check existence of /net/dns or handle anything other then address to ip queries but it is only 1 line...Anonymousnoreply@blogger.com