Function not going to next steps

一世执手 提交于 2019-12-13 17:57:21

问题


I have created below function, when I am executing this function with shell script it completed fine but not going to next steps

 time_check()    
{     
. /u01/scripts/${1}.env     
export create_env_log=${logs}/create_env_log_${dts}.log     
echo 'STime:' date +%s > ${create_env_log}    
  "$@"    
echo 'ETime:' date +%s >> ${create_env_log}    

export st_time= grep -i STime ${create_env_log} |cut -d':' -f2       
export en_time= grep -i ETime ${create_env_log} |cut -d':' -f2      
export exectime=$((en_time-st_time))      
echo 'Completed in ' printf '%dd:%dh:%dm:%ds\n' $(($exectime/86400)) $(($exectime%86400/3600)) $(($exectime%3600/60)) $(($exectime%60))  >>  ${create_env_log}
Totexectime=$((Totexectime+exectime))      
echo 'This step completed in : 'printf '%dd:%dh:%dm:%ds\n' $(($exectime/86400)) $(($exectime%86400/3600)) $(($exectime%3600/60)) $(($exectime%60))      
}

In my shell script I have placed below lines:

time_check /u01/scripts/copy.sh ${1} | tee ${copylog}

echo "Starting Next Steps now:" >>> Issue here , not coming to this phase.

I am getting some output like this:

This step completed in : 0d:0h:12m:9s ( which is output of time_check /u01/scripts/copy.sh )

来源:https://stackoverflow.com/questions/51805468/function-not-going-to-next-steps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!