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.
我正在尝试at在 shell 脚本中使用 Unix 命令(用于将作业设置为在特定时间运行)。时间将由用户输入使用 getopts 和 optarg 指定,这似乎工作正常,问题是at. 如何at根据用户的输入将命令写入脚本以在特定时间运行?
at
谢谢,瑞安
我会说
at now +10 minutes <<< "rm -rf /tmp/tobedeleted"
对于多行,请考虑“HERE-doc”
at now +10 minutes <<ENDMARKER rm -rf /tmp/tobedeleted echo all done | mail -s 'completion notification' sysadmin@example.com ENDMARKER