-z means in unix

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting -z means in unix
# 1  
Old 09-26-2011
-z means in unix

Hi All, I am very new to shell scripting.
Please tell me what is the meansing for below if condition.

if [[ -z $FREQUENCY_MODE || "$FREQUENCY_MODE" != "A" && "$FREQUENCY_MODE" != "D" ]]

Thanks in advance...


Last edited by DukeNuke2; 09-26-2011 at 07:07 PM..
# 2  
Old 09-26-2011
this means :
if $FREQUENCY_MODE variable is empty
OR $FREQUENCY_MODE is different from "A"
AND $FREQUENCY_MODE is different from "D"
# 3  
Old 09-26-2011
Thanks for the quick reply..

-z checks whether the variable is empty or not?

Thanks for the information.
# 4  
Old 09-26-2011
if [[ -z $VAR ]] condition is true if $VAR is empty
if [[ -n $VAR ]] condition is true if $VAR is not empty
This User Gave Thanks to ctsgnb For This Post:
# 5  
Old 09-26-2011
read "man test" for mor information about the condition topic...

and please use code tags for terminal output or script sniplets!
This User Gave Thanks to DukeNuke2 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

$? and $# means

what exactly $? and $# means ? (1 Reply)
Discussion started by: mail2sant
1 Replies

2. Shell Programming and Scripting

What does . means?

Hi, I have seen in some ksh script, that we are executing shell scripts inside other shell script as . variable.sh What is . here? Their is space between . and variabloe. And why we are not executing it like ./variable.sh? I know that . signifies current directory , but what its... (2 Replies)
Discussion started by: jatanig
2 Replies

3. UNIX for Dummies Questions & Answers

What means %U

I can not find out what the %U means in the following command: ooffice -calc %U (2 Replies)
Discussion started by: borobudur
2 Replies

4. UNIX for Advanced & Expert Users

what does $#,$* means

:) Hi, In some script i got these regular expression like , n=$# and for i in $* can anybody let me know, what does it means (5 Replies)
Discussion started by: deb.simply
5 Replies

5. UNIX for Dummies Questions & Answers

Can you tell me what this means?

Can you please tell me what this means? use grep to find from the file myfile.txt all lines containing the sequence tt but not more 2 ts? I have no idea. (2 Replies)
Discussion started by: rushhour
2 Replies

6. Shell Programming and Scripting

$$ means?

hey, what's $$varname in a script? I used to see $varname only. search on google didn't help. thanks. (4 Replies)
Discussion started by: patiobarbecue
4 Replies

7. UNIX for Dummies Questions & Answers

What exactly is a Unix Flavors means??

could anybody tell me what is a unix flavor? (4 Replies)
Discussion started by: human
4 Replies

8. UNIX for Dummies Questions & Answers

what it means?

I have a command called cd $HDRROOT/release/tools/cfg My query is what it means? tHat is.... $HDRROOT part is not clear. If I put this command it says path not found.... I doubt that $HDRROOT is trying to mean smething I am not clear of. PL help......... (4 Replies)
Discussion started by: rraajjiibb
4 Replies

9. UNIX for Advanced & Expert Users

What does ##* means

Hi In one of the thread I have found echo ${SHELL##*/} Can any of u pls let me know, what is the interpretation for ##* over here? Thanks. (2 Replies)
Discussion started by: yeheyaansari
2 Replies
Login or Register to Ask a Question