fixed several bash mistakes and a typo on linkdest part