Chinaunix

标题: bash,Ksh 相同的Bug??? [打印本页]

作者: twf_cc    时间: 2007-06-09 18:51
标题: bash,Ksh 相同的Bug???
剛在網上看到有人問這個是不是 Ksh 的 bug
$ [ skdfjh -ot /etc/group ] && echo hi
hi
$

But "man ksh" says:

  file1 -ot file2
         True, if file1 exists and is older than file2.

But file1 does not exist!

bash 3 一樣啊...

[victor@localhost ~]$ bash --version
GNU bash, version 3.00.16(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.
[victor@localhost ~]$ echo $0
bash
[victor@localhost ~]$ [ skdfjh -ot /etc/shells ] && echo hi
hi
[victor@localhost ~]$

ash 沒問題...
作者: 一梦如是    时间: 2007-06-09 21:36
       file1 -nt file2
              True if file1 is newer (according to modification date)  than
              file2, or if file1 exists and file2 does not.
       file1 -ot file2
              True  if  file1  is  older than file2, or if file2 exists and
              file1 does not.
GNU bash, version 3.1.17(1)-release (i686-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

作者: 一梦如是    时间: 2007-06-09 21:38
有时man手册会由于更新不够及时而变得过时。有info的话,建议看info




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2