-rw-r--r-- 1 oracle oinstall 2653 Feb 23 21:30 awk.out
-rwxr--r-- 1 oracle oinstall 2250 Feb 23 21:20 awk.sh
-rw-r--r-- 1 oracle oinstall 216 Feb 23 11:53 blank_file
-rwxr--r-- 1 oracle oinstall 642 Feb 15 18:43 find.sh
drwxr-xr-x 2 oracle oinstall 4096 Feb 15 17:56 folder
-rw-r--r-- 1 oracle oinstall 620 Feb 24 14:21 ls.out
-rw-r--r-- 1 oracle oinstall 620 Mar 2 14:00 ls.out2
-rwxr-xr-x 1 oracle oinstall 26 Nov 10 22:30 main.sh
-rw-r--r-- 1 oracle oinstall 13956 Mar 6 21:49 orclsid_ora_31518_lubinsu.out
-rw-r--r-- 1 oracle oinstall 608 Mar 3 14:48 result.out
drwxr-xr-x 2 oracle oinstall 4096 Feb 25 22:10 sed.folder
-rwxrwxrwx 1 oracle oinstall 44 Jan 7 22:39 shelltest.sh
drwxr-xr-x 2 oracle oinstall 4096 Mar 3 12:14 sort.folder
-rwxr-xr-x 1 oracle oinstall 99 Feb 23 11:51 test1.sh
-rwxr-xr-x 1 oracle oinstall 99 Feb 23 11:52 test2.sh
drwxr-xr-x 2 oracle oinstall 4096 Mar 3 15:07 tr.folder
[oracle@localhost testDir]$ ll awk
ls: awk: No such file or directory
[oracle@localhost testDir]$ ls -l awk.out
-rw-r--r-- 1 oracle oinstall 2653 Feb 23 21:30 awk.out
[oracle@localhost testDir]$ [ -w awk.out ]
[oracle@localhost testDir]$ echo $?
0
[oracle@localhost testDir]$ [ -x awk.out ]
[oracle@localhost testDir]$ echo $?
1
[oracle@localhost testDir]$ test -x awk.out
[oracle@localhost testDir]$ echo $?
1
[oracle@localhost testDir]$ test -d folder
[oracle@localhost testDir]$ echo $?
0
[oracle@localhost testDir]$
[oracle@localhost testDir]$ test -u test1.sh
[oracle@localhost testDir]$ echo $?
1
[oracle@localhost testDir]$ [ -x test1.sh -a -w test2.sh ]
[oracle@localhost testDir]$ echo $?
0
[oracle@localhost testDir]$ [ -w result.out -a -x result.out ]
[oracle@localhost testDir]$ echo $?
1
[oracle@localhost testDir]$ [ -w result.out -o -x result.out ]
[oracle@localhost testDir]$ echo $?
0
[oracle@localhost testDir]$ [ -z $EDITOR ]
[oracle@localhost testDir]$ echo $?
0
[oracle@localhost testDir]$ [ $EDITOR = "vi" ]
-bash: [: =: unary operator expected
[oracle@localhost testDir]$ [ $EDITOR = "vi" ]
-bash: [: =: unary operator expected
[oracle@localhost testDir]$ [ $EDITOR = "vi" ]
-bash: [: =: unary operator expected
[oracle@localhost testDir]$ echo $EDITOR
[oracle@localhost testDir]$ testStr=vi
[oracle@localhost testDir]$ echo $testStr
vi
[oracle@localhost testDir]$ [ $testStr = "vi" ]
[oracle@localhost testDir]$ echo $?
0
[oracle@localhost testDir]$ [ $testStr = "v" ]
[oracle@localhost testDir]$ echo $?
1
[oracle@localhost testDir]$ expr 10 + 10
20
[oracle@localhost testDir]$ expr 10 + 100
110
130310
[oracle@localhost testDir]$ var1=`date +%Y%m%d`
[oracle@localhost testDir]$ echo ${var1}
20130310
[oracle@localhost testDir]$ expr ${var1}+1
20130310+1
[oracle@localhost testDir]$ expr ${var1} + 1
20130311
[oracle@localhost testDir]$ loop=1
[oracle@localhost testDir]$ loop=`expr ${loop} + 1`
[oracle@localhost testDir]$ echo ${loop}
2
--模式匹配功能
[oracle@localhost testDir]$ var2=word.doc
[oracle@localhost testDir]$ expr $var2 : '\(.*\).doc'
word
分享到:
相关推荐
linux shell 条件测试
【软件测试】:测试用例:边界条件测试.doc
条件测试说明条件测试说明条件测试说明条件测试说明条件测试说明条件测试说明
shell 基本知识,包括控制结构,条件测试,通配符,引号等
Draxler和Zessin [1]推导了一类假设为Rasch模型的心理测验模型的条件测试的功效函数,并建议了由Verhelst [2]开发的MCMC方法,用于对功效的数值近似。 在此贡献中,对Verhelst方法的精度进行了研究,并将其与Miller...
本文介绍了单元测试(1 模块接口测试;2 模块局部数据结构测试;3模块中所有独立执行通路测试 ;4 模块的各条错误处理通路测试;5 模块边界条件测试。)中应该注意的重点
shell中条件测试.docx
26 条件测试及if语句.mp4
Linux详细教程大全之shell脚本基础2-条件测试及控制流
七年级数学探索三角形全等的条件测试题.doc
Bash条件测试之文件测试–a/E FILE:存在文件为真练习:存在文件显示文件行数,不存在显示不存在–d FILE:存在且为目录文件为真–f FILE:存在且
5.2: 条件测试 、 if选择结构 、 循环结构 、 总结和答疑.docx
详细地介绍测试用例总结,边界条件《软件测试实用技术与常用模板》作者李龙 教材中附赠
一、条件测试操作 要使Shell脚本程序具备一定的“智能”,面临的第一个问题就是如何区分不同的情况以确定执行何种操作。Shell环境根据命令执行后的返回状态值(¥?)来判断是否执行成功,当返回值为0时表示成功,...
目录 一 软件测试 从零开始 5 1.1 引言 5 1.2 测试准备工作 5 1.2.1 向有经验的测试人员学习 5 1.2.2 阅读软件测试的相关...16.5.1 条件测试 108 16.5.2 数据流测试 110 16.5.3 循环测试 111 16.6 黑盒测试 112
停止测试的条件 测试的基本文档包括哪些 简要的说明一下软件工程中的V模型 为什么要开展测试工作 测试团队在项目中的基本责任是什么 软件缺陷的定义是什么 软件错误的分类有哪些 一个优秀的测试工程师需要具备的素质...
第三章 测试前的输入条件测试准备的输出资料 第四章 根据测试进度、相关测试计划和实际测试情况确定测试阶段 第五章 单元测试、确认测试和系统测试根据具体情况对问题进行处理 第六章 验收测试 第七章 测试通过标准 ...
目录 一 软件测试 从零开始 5 1.1 引言 5 1.2 测试准备工作 5 1.2.1 向有经验的测试人员学习 5 1.2.2 阅读软件测试的相关...16.5.1 条件测试 108 16.5.2 数据流测试 110 16.5.3 循环测试 111 16.6 黑盒测试 112
=,-n,-z文件测试在实现比较时,字符串最好加上单双引号,变量加双引号不存在时默认为空例如:hostname命令——查看或修改当前主机名练习:如果当前主机名为
动态响应一般是指控制系统在典型输入信号的作用下,其输出量从初始状态到终状态的响应。对某一环节(系统)加入单位... 测试条件测试数据及示意图 测试步骤 什么样的结果算合格? 动态响应与什么有关?该如何