return all matching rattrs if specified. for example, minooka; ndb/query sys kibbiee ip=205.185.197.14 ip=205.185.197.15 ip=205.185.197.16 sys=kibbiee ether=0030488b57c2 dom=kibbiee.coraid.com bootf=/386/9pxeload4 console=sukhoi minooka; ndb/query sys kibbiee ip 205.185.197.14 205.185.197.15 205.185.197.16 minooka; /n/dump/2007/0718/386/bin/ndb/query sys kibbiee ip 205.185.197.14 Notes: Sun Aug 5 21:53:37 EDT 2007 geoff this might be the right thing to do, but it is a change of semantics and may break or at least disturb existing shell scripts. Wed Aug 29 17:32:53 EDT 2007 geoff implemented as options and made a little more general. Reference: /n/sources/patch/applied/query-allrattr Date: Fri Jul 20 00:45:05 CES 2007 Signed-off-by: quanstro@speakeasy.net Reviewed-by: geoff --- /sys/src/cmd/ndb/query.c Fri Jul 20 00:36:54 2007 +++ /sys/src/cmd/ndb/query.c Fri Jul 20 00:36:53 2007 @@ -21,9 +21,13 @@ Ndbtuple *t, *nt; if(rattr){ - p = ndbgetvalue(db, &s, attr, val, rattr, nil); + p = ndbgetvalue(db, &s, attr, val, rattr, &nt); + for(t = nt; t; t = t->entry){ + if(strcmp(t->attr, rattr) == 0) + print("%s\n", t->val); + } if(p){ - print("%s\n", p); + ndbfree(nt); free(p); } return;