remove trailing "; fi"