LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   compound if statement (https://www.linuxquestions.org/questions/linux-newbie-8/compound-if-statement-869921/)

ted_chou12 03-21-2011 02:05 AM

compound if statement
 
Hi, I want to include several things in one statement, I am not sure what the syntax is:
Code:

if [[ $EXT="mp3" ] || [ $EXT="wma" ] || [ $EXT="wmv" ]] AND [ $ISDIR!="d" ] ; then
....
...
...
....
fi

Thanks,

paulsm4 03-21-2011 02:17 AM

Sure. You can use "|" for "or", "&" for "and".

Look here for more details:
http://www.gnu.org/software/bash/man...al-Expressions

Or here:
http://www.linuxconfig.org/Bash_scripting_Tutorial


All times are GMT -5. The time now is 05:26 PM.