为什么我的“at”子句命令会立即执行 shell 并忽略时间限制?

Zen*_*Zen 4 command-line bash at-command

我写了一个名为t.sh的shell ,内容是:

touch 88888
Run Code Online (Sandbox Code Playgroud)

我正在使用的命令是

sh t.sh | at 03:13Jun15
Run Code Online (Sandbox Code Playgroud)

执行此命令后,我在屏幕上看到了这个节目:

warning: commands will be executed using /bin/sh
job 9 at Sun Jun 15 03:13:00 2014
Run Code Online (Sandbox Code Playgroud)

很明显,这将在 Sun Jun 15 03:13:00 2014 执行

但是当我检查我的文件夹时,我发现那里存在一个 88888 文件。Rmoved它并再次尝试,仍然是相同的结果。

这里有什么问题?它会是一个 bash/sh 的事情吗?因为我看到它说将由 /bin/sh 执行?

Jos*_*Jos 13

at如果您指定了-f标志,则从标准输入或文件中读取命令。什么sh t.sh | at [time]是:

1. execute the shell script t.sh *right now*; 
2. pipe the output of the shell script to at. 
Run Code Online (Sandbox Code Playgroud)

但是脚本没有输出,所以周日没有什么可以执行的。

你想要的是at 03:13Jun15 -f t.sh.