2010-10-23 17 views

回答

11

多數系統有一個/usr/bin/false

NAME 
    false -- Return false value. 

SYNOPSIS 
    false 

DESCRIPTION 
    The false utility always exits with a nonzero exit code. 

SEE ALSO 
    csh(1), sh(1), true(1) 

STANDARDS 
    The false utility conforms to IEEE Std 1003.2-1992 (``POSIX.2''). 
+1

完美,謝謝! (我用'/ usr/bin/true') – 2010-10-23 18:01:06

+2

在現代系統上通常是'/ bin/true'。在哪個操作系統上是'/ usr/bin/true'? – 2010-10-23 21:21:43

+0

它在Solaris 10上。 – 2010-10-25 13:10:33

0

也許

abort //does not return 

或可能

test true //returns 0 
test false // returns 1 
test  // returns 1 
0

爲什麼不自己做在同一個目錄?

4

聽起來像內置

: [arguments] 
     No effect; the command does nothing beyond expanding arguments 
     and performing any specified redirections. A zero exit code is 
     returned. 
0

的 「冒號」 工作儘量空反引號

``

echo $?

給出0。

相關問題