Generalize bash script.