这是一个奇怪的事.
在Windows Vista上的Cygwin bash上,我可以得到这样的日期:
$ date
2010-11-30 4:40:48 AM PST
xah@xah-PC ~
$ date +%s
1291120855
Run Code Online (Sandbox Code Playgroud)
但在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)
Run Code Online (Sandbox Code Playgroud)
知道发生了什么事吗?
这是因为您的emacs shell实际上是一个Windows命令提示符shell,并且date命令被发送到它并失败.
看一下这个问题,找出如何配置emacs来使用Cygwin的bash shell: