Problem 3

Due next week

The Unix command nslookup may be used to list all of the IP names and numbers defined in a nameserver. For example, the J expression:

junk =: system 'echo "ls trinity.edu > junk" | nslookup'
pipes the command ls trinity.edu > junk to the nslookup command. The result of executing this command is not useful, but the file, named junk, contains the names and IP numbers of which are defined in the Trinity.Edu database.

Suppose the following definition:

box_cut =: box ;. _2

Then, the J expression

csipnames =: open atop box_cut system 'grep 131\.194\.131. junk'
retrieves just those IP names and numbers associated with the Trinity Computer Science domain CS.Trinity.Edu.

Using the above three definitions, write a J program which will compute two different versions of the IP names and numbers for the CS.Trinity.Edu domain, sorted alphabetically by name and sorted numerically (increasing order) by IP number.



2/1/1999