Add extract function to bash.