getopt in bash
How to properly read command line arguments for a bash script and do it well even without getopt:
I think the syntax is much cleaner than that of getopt’s as well – that is, if you’ve even got a bash version supporting getopt.
Edit: Thanks Willem D’Haese for pointing out the missing esac
.