
- Forum
- Testing
- Software Testing
- Testing On Unix
Testing On Unix
This is a discussion on Testing On Unix within the Software Testing forums, part of the Testing category; can you guide me how to test in unix...
-
03-02-2010, 10:44 PM #1
- Join Date
- Mar 2010
- Answers
- 1
Testing On Unix
can you guide me how to test in unix
-
Test is a condition evaluation command.The test command evaluates the expression if the value is True,returns a zero exit status; otherwise,a nonzero exit status is returned.test also returns a nonzero exit status if there are no arguments.
-
02-29-2012, 01:10 PM #3
- Join Date
- Feb 2012
- Answers
- 66
We can test in UNIX with the help of commands along with some test conditions.They returns 0 for true and 1 for false.
Syntax:test - either test condition or [ condition ]
Strings are compared with =, !=, >, and <.
For example, test "$1" = "yes" is true if $1 is "yes".
Numbers are compared with -eq (equal), -ne (not equal), -lt (less than), -le (less than or equal), -gt (greater than), -ge (greater than or equal to).
For example, test $1 -lt 4 means that $1 is a number less than 4.
Here are some other conditions:
test -r file True if file file exists and is readable.
test -w file True if file file exists and is writeable.
test -x file True if file file exists and is executable.
test -d file True if file file exists and is a directory.
test -s file True if file file exists and has a size greater than 0.
test -z string True if string string exists is length 0.
-
Sponsored Ads

Reply With Quote





