hi
New to shell scripting. While trying hands at it I came across the operators -z -o in the if block.
Any relevant info would be appreciated
if [ -z "$xa_" -o "$va_" == "yes" ]
cheers guys
hi
New to shell scripting. While trying hands at it I came across the operators -z -o in the if block.
Any relevant info would be appreciated
if [ -z "$xa_" -o "$va_" == "yes" ]
cheers guys
Hello,
Hope this helps. From O’Reilly Media, Inc. bash Cookbook.
Test Operators
The operators in Table are used with test and the [...] and [[...]] constructs.
They can be logically combined with -a (“and”) and -o (“or”) and grouped with
escaped parenthesis ((...)).
Table A-9. Test operators
Operator True if
-a file file exists, deprecated, same as -e
-b file file exists and is a block device file
-c file file exists and is a character device file
-d file file exists and is a directory
-e file file exists; same as -a
-f file file exists and is a regular file
-g file file exists and has its setgid bit set
-G file file exists and is owned by the effective group ID
-h file file exists and is a symbolic link, same as -L
-k file file exists and has its sticky bit set
-L file file exists and is a symbolic link, same as -h
-n string string is non-null
-N file file was modified since it was last read
-O file file exists and is owned by the effective user ID
-p file file exists and is a pipe or named pipe (FIFO file)
-r file file exists and is readable
-s file file exists and is not empty
-S file file exists and is a socket
-t N File descriptor N points to a terminal
-u file file exists and has its setuid bit set
-w file file exists and is writeable
-x file file exists and is executable, or file is a directory that can be searched
-z string string has a length of zero
thanks fella .. big help :)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.