#!/bin/bash . /opt/aspire/product/bdc/.bash_profile cd /simsfile/sgcx/cxwj ################################################## YEA_TIME="date +%Y" MOU_TIME="date +%m" DAY_TIME="date +%d" MED_DAY=16 if[ ${DAY_TIME} -gt ${MDE_DAY} ] then DAY_STIME=16 MOU_STIME=$MOU_TIME echo "ret time 后面的是 ${YEA_TIME}${MOU_STIME}${DAY_STIME}000000" else DAY_STIME=01 MOU_STIME=$MOU_TIME echo "ret time 后面的是 ${YEA_TIME}${MOU_STIME}${DAY_STIME}000000" fi
[bdc_cs1@cs-sjjh02 210]$ sh date.sh
date.sh: line 11: if[ date: command not found
date.sh: line 12: syntax error near unexpected token `then'
date.sh: line 12: `then'