bash version.
has some known bugs, but works when arguments are given correctly.