这里有一个奇怪的地方。
在 Windows Vista 的 Cygwin bash 上,我可以得到这样的日期:
$ date
2010-11-30 4:40:48 AM PST
xah@xah-PC ~
$ date +%s
1291120855
但是在 emacs“shell”中,运行相同的日期命令,我得到了这个:
c:\Users\xah\web\xahlee_org\comp>which date
which date
/usr/bin/date
c:\Users\xah\web\xahlee_org\comp>date
date
The current date is: 2010-11-30
Enter the new date: (yy-mm-dd)
c:\Users\xah\web\xahlee_org\comp>date +%s
date +%s
The system cannot accept the date entered.
Enter the new date: (yy-mm-dd)
知道发生了什么吗?
最佳答案
这是因为您的 emacs shell 实际上是一个 Windows 命令提示符 shell,并且 date 命令被发送给它但失败了。
查看这个问题,了解如何配置 emacs 以改为使用 Cygwin 的 bash shell:
关于bash - 在 emacs shell 中运行 unix date util 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4313914/