bash - 在 emacs shell 中运行 unix date util 的问题

标签 bash shell emacs

这里有一个奇怪的地方。

在 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:

How can I run Cygwin Bash Shell from within Emacs?

关于bash - 在 emacs shell 中运行 unix date util 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4313914/

相关文章:

emacs - 在 EMACS org.mode 中覆盖 Ctrl-TAB

emacs - slime 在 emacs24 中不起作用

php - 将 .csv 数据回显到文件

linux - 计算字符串中出现的次数。 Linux

linux - 如何使用 shell 脚本替换属性文件中的点

linux - 区分目录名或目录路径

emacs - 为什么 elisp 局部变量在这种情况下保持其值?

linux - 更智能、更简洁的方法来匹配 shell 脚本中的输入变量?

linux - 如何用 Bash 求和日期

linux - Ubuntu: "Startup Applications"中的 shell 脚本