[wplug] nis problem
James O'Kane
jo2y at midnightlinux.com
Thu Sep 26 23:02:30 EDT 2002
On Thu, 26 Sep 2002 bpmedley at 4321.tv wrote:
> Interesting. Can you shed any light as to why it's setup like that?
Sure, it is a simple has database. when do ypcat -k the column on the left
is the key. If you want to find bob, it looks for the value associated
with the 'bob' key. If you want to find bob.ld you find the value
associated with bob.ld, which in this case happens to be the same. I think
to do it any other way would require parsing of the file format each time.
Looking things up by key, value can be done quickly.
Assuming you are doing /etc/passwd in nis as well. When you do ypcat
passwd, you see the contents of a passwd file. However, doing a query
doesn't actually look at the first part of that output. It looks at the
key that can be seen when you do ypcat -k passwd.
At the moment, I don't know of an example, buy say you wanted an NIS map
from numberic digits to their english names.
'ypcat numbers' might output:
one
two
three
four
and ypcat -k numbers might output:
1 one
2 two
3 three
4 four
In this case, I hope it is clearer why it is setup this way? Here, the key
is not part of the value.
-james
More information about the wplug
mailing list