The getent.1 manual says: For cgetcap(3) style databases (disktab, printcap) specifying a key, lists the entry for that key, and specifying more arguments after the key are used as fields in that key, and only the values of the keys are returned. For boolean keys true is returned if the key is found. If a key is not found, then false is always returned.
I only looked at this part of the code briefly. I think the manpage means to say: "... only the values of the fields are returned. For boolean fields, `true' is returned if the field is found. If a field is not found, then `false' is always returned." But I cannot reproduce it, for example: t1:reed$ getent disktab floppy ty t1:reed$ getent disktab floppy ob t1:reed$ getent disktab floppy pc t1:reed$ getent gettytab Console rw But I would think it would be like this: t1:reed$ getent disktab floppy ty floppy t1:reed$ getent disktab floppy ob 0 t1:reed$ getent disktab floppy pc 2880 t1:reed$ getent gettytab Console rw true Note that getent with the entry does work: t1:reed$ getent disktab floppy floppy|3.5in High Density Floppy:ty=floppy:se#512:nt#2:rm#300:ns#18:nc#80:pa#2880:oa#0:ba#4096:fa#512:ta=4.2BSD:pb#2880:ob#0:pc#2880:oc#0: t1:getent$ ./getent gettytab Console Console|Console Decwriter II:rw:sp#300: Am I doing this wrong to get the value? Or is this not working? Or maybe I don't understand the manual. (By the way, I just sent a patch to tech-userlevel to add login.conf support to getent(1) but this problem is in an unpatched version too.) Thanks, Jeremy C. Reed echo 'EhZ[h ^jjf0%%h[[Zc[Z_W$d[j%Xeeai%ZW[ced#]dk#f[d]k_d%' | \ tr '#-~' '\-.-{'