linux - 功能不进入下一步
问题描述
我已经创建了下面的函数,当我使用 shell 脚本执行这个函数时,它完成得很好,但不会进入下一步
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))
}
在我的 shell 脚本中,我放置了以下几行:
time_check /u01/scripts/copy.sh ${1} | tee ${copylog}
echo "Starting Next Steps now:" >>> Issue here , not coming to this phase.
我得到一些这样的输出:
此步骤在 0d:0h:12m:9s 完成(这是 time_check /u01/scripts/copy.sh 的输出)
解决方案
推荐阅读
- mysql - 在 Windows 10 上安装 MySQL 服务器时出错
- biztalk - BizTalk server2010 支持的密码
- vba - 检查一个空的文本框
- css - 无头 Chrome 以大窗口大小呈现 @media 样式
- amazon-web-services - AWS Glue ETL 脚本生成和可移植性
- python - python打印每个字,为什么?
- c# - AdMob/Unity - 奖励视频未显示
- python - 做某事。如果在熊猫数据框中列中出现的值等于 1
- python - Pygame 显示 2D numpy 数组
- java - Spark-Java:如何替换数据集中的列名
换个新名字?