The shell script stop here: sed -i s'/^/wget /' CTCF_DOWNLOAD sed: 1: "CTCF_DOWNLOAD": invalid command code C I change it into: sed -i -e 's/^/wget /' CTCF_DOWNLOAD and the bug is fixed.