LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2011, 03:05 AM   #1
ted_chou12
Member
 
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 421
Blog Entries: 28

Rep: Reputation: 2
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,
 
Old 03-21-2011, 03:17 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Shell script for adding a statement in a file after a particular statement TheIndependentAquarius Programming 4 06-28-2010 04:07 AM
Problem with if statement in a find -exec statement romsieze Programming 2 10-02-2008 01:38 AM
c compound conditional steve_96 Programming 9 06-04-2005 08:17 PM
warning: deprecated use of label at end of compound statement abk4523 Programming 1 03-06-2005 10:50 AM
Compound Problems bselzler Linux - Networking 0 09-09-2001 10:30 AM


All times are GMT -5. The time now is 02:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration