Generalize convertcd.sh script.