1
我正在bash脚本中运行一些mongodb命令,但需要在heredoc文本中插入一个字符串。我无法正确插入值。这将如何完成?将变量插入到bash脚本中mongodb命令heredoc
today=`date -d "00:00:00" +%s`
todaytime=$(($today*1000))
mongo <<EOF > test
use log
db.translogs.remove("{Dt: {$lt: new Date($todaytime)}}")
exit
EOF