【发布时间】:2019-02-16 06:01:31
【问题描述】:
我正在尝试生成一个带有 .sh 和在 shell 中定义的变量的 HTML 文件
[root@ip-xxx-xx-x-xxx Reporting]: IMAGE_TAG=xyzabc
.sh文件代码
#!/bin/bash
echo "<!DOCTYPE html>" > fargateproductiondeploy.html
echo "<html> <body>" >> fargateproductiondeploy.html
echo "<h2>Following Docker container
will be deployed will be Deployed in production up on Approval </h2>
<ol>" >> fargateproductiondeploy.html
echo "<li>$IMAGE_TAG </li>" >> fargateproductiondeploy.html
从 HTML 文件中运行 ./generatehtml.sh 后是
Following Docker container will be deployed will be Deployed in
production upon Approval
1.
【问题讨论】:
-
先做
export IMAGE_TAG=xyzabc有效果吗?
标签: bash shell variables scripting