示例#!/bin/bashtimestamp=`date"+%Y%m%d%H%M%S"`baseDir=$(cd"$(dirname"$0")";pwd)sed"s/version/$timestamp/g"${baseDir}/demo.yaml>${baseDir}/tmp.yml在sed中使用变量,在shell脚本中使用双引号执行函数,用``引用

示例#!/bin/bashtimestamp=`date"+%Y%m%d%H%M%S"`baseDir=$(cd"$(dirname"$0")";pwd)sed"s/version/$timestamp/g"${baseDir}/demo.yaml>${baseDir}/tmp.yml在sed中使用变量,在shell脚本中使用双引号执行函数,用``引用