在互联网上搜索,我发现只有“$@”的解释,意思是“扩展到位置参数”。但是我找不到关于 @ 符号本身的任何信息。
我在这个问题的公认答案的第三个片段中偶然发现了它: https://superuser.com/questions/611538/is-there-a-way-to-display-a-countdown-or-stopwatch-timer-in-a-terminal
具体来说:
date -u --date @$((`date +%s` - $date1)) +%H:%M:%S
最佳答案
在您显示的上下文中,@
位于 --date
命令的 --date
参数的开头:
date -u --date @$((`date +%s` - $date1)) +%H:%M:%S
在那种情况下,这意味着参数应该被视为自纪元以来的秒数,请参见 man date
中的示例:
Convert seconds since the epoch (1970-01-01 UTC) to a date
$ date --date='@2147483647'
或:
$ date -u -d @0
Thu Jan 1 00:00:00 UTC 1970
@
的含义由 date
实用程序单独定义,而不是由 bash
定义。
关于bash - bash 命令 : date --date @. 中的 @ 符号是什么意思 ..?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28719148/