通过date -d从文件中读取将日期和时间传递给命令
我试过:
#cat temp.txt
2013/10/31 10:57:02
#cat temp.txt | xargs date -d
date: the argument `10:57:02' lacks a leading `+';
when using an option to specify date(s), any non-option
argument must be a format string beginning with `+'
Run Code Online (Sandbox Code Playgroud)
你可以说:
cat temp.txt | xargs -i date -d {}
Run Code Online (Sandbox Code Playgroud)
date -d "$(<temp.txt)"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2771 次 |
| 最近记录: |