[[ $? -eq 0 ]] &&  { echo -e "\e[1;32mscp $binname success\e[0m"|tee -a $log_file ; } || { echo -e "\e[1;31mscp $binname failed\e[0m"|tee -a $log_file; exit 1; }

主意{}最后一条命令要加