From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ar.aichi-u.ac.jp ([202.250.160.40]) by ur; Tue Sep 29 19:35:19 EDT 2015 Received: from [192.168.0.249] ([123.1.2.225]) by ar; Wed Sep 30 08:35:05 JST 2015 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [9front] delkey(1) From: arisawa In-Reply-To: Date: Wed, 30 Sep 2015 08:35:05 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: RESTful NoSQL HTTP over SQL deep-learning configuration-aware interface References: To: 9front@9front.org X-Mailer: Apple Mail (2.2104) Hello > 2015/09/30 7:21=E3=80=81Julius Schmidt = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=EF=BC=9A >=20 > delkey(1) strikes me as stupid. > it should be more like >=20 > % delkey > echo 'delkey proto=3Dhj user=3Ddicks' >/mnt/factotum/ctl > echo 'delkey proto=3Dp9sk1 user=3Dglenda' > /mnt/factotum/ctl > etc >=20 > instead of the silly yes/no prompting. I love the script below. hebe% cat /usr/local/bin/rc/fact #!/bin/rc # # fact is a tool to manage factotum.=20 # rfork e usage=3D'usage: fact [-adl]' fn addkey { echo adding to $1 cat $1 echo '# put data and RETURN' awk '/^$/{exit} /.+/{print}' | read -m >/$1 # awk '/^$/{exit} /.+/{print}' >/$1 } fn delkey { echo deleting from $1 #sed s/key/delkey/g < $1 sed 's/key/delkey/g;s/!.*?//g' < $1 echo '# send and RETURN' awk '/^$/{exit} /.+/{print}' | read -m > $1 # awk '/^$/{exit} /.+/{print}' > $1 } ctl=3D() f=3D(/mnt /mnt/term/mnt)^/factotum/ctl if(test -w $f(2)) ctl=3D$f(2) if(test -w $f(1)) ctl=3D$f(1) while(~ $1 -*){ switch($1){ case -d delkey $ctl exit case -d1 delkey $f(1) exit case -d2 delkey $f(2) exit case -a addkey $ctl exit case -a1 addkey $f(1) exit case -a2 addkey $f(2) exit case -l f=3D(/mnt /mnt/term/mnt)^/factotum for (x in $f) if(test -e $x) ls -l $x exit case -* echo $usage exit usage }=09 shift } for (x in $f) if(test -w $x){ ls -l $x cat $x } hebe%=20