convert
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | convert [2006/07/25 21:22] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: convert.txt, | ||
+ | ======Synopsis: | ||
+ | $convert(< | ||
+ | |||
+ | ======Technical: | ||
+ | This function does a DNS lookup on the given address. | ||
+ | it attempts to find the corresponding Internet hostname. | ||
+ | it attempts to find the corresponding IP address. | ||
+ | |||
+ | ======Practical: | ||
+ | This function does effectively the same thing as $[[iptoname]]() and | ||
+ | $[[nametoip]](). | ||
+ | you aren't sure if the input will be an IP address or not. | ||
+ | |||
+ | ======Returns: | ||
+ | IP address or hostname corresponding to input, or nothing on error | ||
+ | |||
+ | ======Examples: | ||
+ | < | ||
+ | $convert(some.school.edu) | ||
+ | $convert(192.168.1.1) | ||
+ | </ | ||
+ | |||
+ | An easy example of this in a script is: | ||
+ | |||
+ | < | ||
+ | alias dns { | ||
+ | echo Matched $0 to $convert($0) | ||
+ | } | ||
+ | </ | ||
convert.txt · Last modified: 2006/07/25 21:22 by 127.0.0.1