隨筆-49  評論-67  文章-27  trackbacks-0
          suse:~ # help test
          test: test [expr]
              Exits with a status of 0 (true) or 1 (false) depending on
              the evaluation of EXPR.  Expressions may be unary or binary.  Unary
              expressions are often used to examine the status of a file.  There
              are string operators as well, and numeric comparison operators.
             
              File operators:
             
                  -a FILE        True if file exists.
                  -b FILE        True if file is block special.
                  -c FILE        True if file is character special.
                  -d FILE        True if file is a directory.
                  -e FILE        True if file exists.
                  -f FILE        True if file exists and is a regular file.
                  -g FILE        True if file is set-group-id.
                  -h FILE        True if file is a symbolic link.
                  -L FILE        True if file is a symbolic link.
                  -k FILE        True if file has its `sticky' bit set.
                  -p FILE        True if file is a named pipe.
                  -r FILE        True if file is readable by you.
                  -s FILE        True if file exists and is not empty.
                  -S FILE        True if file is a socket.
                  -t FD          True if FD is opened on a terminal.
                  -u FILE        True if the file is set-user-id.
                  -w FILE        True if the file is writable by you.
                  -x FILE        True if the file is executable by you.
                  -O FILE        True if the file is effectively owned by you.
                  -G FILE        True if the file is effectively owned by your group.
                  -N FILE        True if the file has been modified since it was last read.
             
                FILE1 -nt FILE2  True if file1 is newer than file2 (according to
                                 modification date).
             
                FILE1 -ot FILE2  True if file1 is older than file2.
             
                FILE1 -ef FILE2  True if file1 is a hard link to file2.
             
              String operators:
             
                  -z STRING      True if string is empty.
             
                  -n STRING
                  STRING         True if string is not empty.
             
                  STRING1 = STRING2
                                 True if the strings are equal.
                  STRING1 != STRING2
                                 True if the strings are not equal.
                  STRING1 < STRING2
                                 True if STRING1 sorts before STRING2 lexicographically.
                  STRING1 > STRING2
                                 True if STRING1 sorts after STRING2 lexicographically.
             
              Other operators:
             
                  -o OPTION      True if the shell option OPTION is enabled.
                  ! EXPR         True if expr is false.
                  EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.
                  EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.
             
                  arg1 OP arg2   Arithmetic tests.  OP is one of -eq, -ne,
                                 -lt, -le, -gt, or -ge.
             
              Arithmetic binary operators return true if ARG1 is equal, not-equal,
              less-than, less-than-or-equal, greater-than, or greater-than-or-equal
              than ARG2.
          posted on 2007-08-12 10:38 思考 閱讀(281) 評論(0)  編輯  收藏 所屬分類: Linux
          主站蜘蛛池模板: 太白县| 建德市| 滦平县| 松滋市| 衡阳市| 定陶县| 瓦房店市| 湟中县| 唐河县| 宿州市| 蓬溪县| 昔阳县| 阿拉善右旗| 万州区| 新宁县| 普定县| 香河县| 高青县| 綦江县| 阿克苏市| 化州市| 宁南县| 施秉县| 轮台县| 札达县| 彭阳县| 叙永县| 修武县| 班戈县| 郓城县| 江城| 南部县| 玉龙| 芒康县| 安泽县| 余庆县| 清原| 巢湖市| 南丰县| 汶川县| 台北县|