Pete's Linux Advent Calendar 2007
The 23rd day
Now for something completely different
Of course, bash isn't the answer to all tasks. When it comes
to networking, for example, other languages are preferred.
Although bash is able to connect to the network via the
special file /dev/tcp (not under Debian because the maintainer
thinks that Bash shouldn't be able to do that, well... I don't
agree). Anyways, this resolves the given hostname:
#!/usr/bin/python
import sys,socket
print socket.gethostbyname(sys.argv[1])