Linux Shell : Test命令参数解析
2008-11-25 13:18
447 查看
http://209.85.173.132/search?q=cache:56H3TqbWaWwJ:blog.csdn.net/wwalpha/archive/2006/10/23/1347584.aspx+linux+shell+test&hl=zh-CN&ct=clnk&cd=3
格式: test[/b] conditions
test[/b] -n string : string 不为空
test[/b] -z string : string 为空
test[/b] int1 -eq int2 : int1 == int 2
test[/b] int1 -ne int2 : int1 != int2
test[/b] int1 -gt int2 : int1 > int2
test[/b] int1 -ge int2 : int1 >= int2
test[/b] int1 -lt int2 : int1 < int2
test[/b] int1 -le int2 : int1 <= int2
test[/b] -r filename : 用户对文件filename有读权限
test[/b] -w filename : 用户对文件filename有写权限
test[/b] -x filename : 用户对文件filename有可执行权限
test[/b] -f filename : 文件filename为普通文件
test[/b] -d filename : 文件filename为目录
test[/b] -c filename : 文件filename为字符设备文件
test[/b] -b filename :文件filename为块设备文件
test[/b] -s filename : 文件filename大小不为零
test[/b] -t fnumb : 与文件描述符fnumb(默认值为1)相关的设备是一个终端设备
test[/b] ! -s empty : empty 为空
test[/b] -a : And
test[/b] -o : Or
格式: test[/b] conditions
test[/b] -n string : string 不为空
test[/b] -z string : string 为空
test[/b] int1 -eq int2 : int1 == int 2
test[/b] int1 -ne int2 : int1 != int2
test[/b] int1 -gt int2 : int1 > int2
test[/b] int1 -ge int2 : int1 >= int2
test[/b] int1 -lt int2 : int1 < int2
test[/b] int1 -le int2 : int1 <= int2
test[/b] -r filename : 用户对文件filename有读权限
test[/b] -w filename : 用户对文件filename有写权限
test[/b] -x filename : 用户对文件filename有可执行权限
test[/b] -f filename : 文件filename为普通文件
test[/b] -d filename : 文件filename为目录
test[/b] -c filename : 文件filename为字符设备文件
test[/b] -b filename :文件filename为块设备文件
test[/b] -s filename : 文件filename大小不为零
test[/b] -t fnumb : 与文件描述符fnumb(默认值为1)相关的设备是一个终端设备
test[/b] ! -s empty : empty 为空
test[/b] -a : And
test[/b] -o : Or
相关文章推荐
- Linux Shell : Test命令参数解析
- Linux Shell : Test命令参数解析
- Linux Shell : Test命令参数解析
- linux Shell : Test命令参数解析
- Linux Shell : Test命令参数解析
- Linux Shell : Test命令参数解析
- Shell Test命令参数解析
- Shell Test命令参数解析
- Shell Test命令参数解析
- Linux shell 的 test 命令用法详解
- Linux shell 命令参数分隔符
- Linux shell中的test命令用法教程
- getopt----解析命令选项及参数
- Linux SHELL if 命令部分参数说明
- Linux SHELL if 命令参数说明
- caffe命令及其参数解析
- caffe命令及其参数解析
- linux shell中的命令自动补全(compgen complete)与 命令行参数解析
- asterisk dial 命令参数解析
- 命令调用C#程序, 路径参数解析错误