Chinaunix

标题: 请教个问题,双减号在bash代表什么 [打印本页]

作者: hejianet    时间: 2011-11-02 12:23
标题: 请教个问题,双减号在bash代表什么
本帖最后由 hejianet 于 2011-11-02 12:27 编辑
  1. function ABC
  2. {
  3.     local interval=$_SEMAPHORE_WAIT; [ -z $interval ] && return -- -1;
  4. }
复制代码
这个return -- -1; 和return -1;有区别么
多谢
补充一下是在bash中
作者: waker    时间: 2011-11-02 12:31
表示-- 后面的参数不是选项
作者: waker    时间: 2011-11-02 12:34
另外,如果return 的值不是0-255,可能得不到你想象的结果
作者: Shell_HAT    时间: 2011-11-02 12:38
       --        A  --  signals the end of options and disables further option
                 processing.  Any arguments after the -- are treated as  file-
                 names and arguments.  An argument of - is equivalent to --.





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