Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 bash 脚本中获取旧日期,但它会引发此错误
"./bkc.sh: line 10: 20130122: command not found"
这就像尝试将结果日期用作函数而不是将值分配给 OLDATE var。
这是我的代码:
OLDATE= `date -d '7 days ago' +'%Y%m%d'`
谁能帮我 ?谢谢
只需删除 OLDATE 和命令之间的空格即可。
Bash 不希望在赋值时使用空格