LinuxQuestions.org
Help answer threads with 0 replies.
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 02-02-2011, 07:53 PM   #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
if statement with multiple tasks


Hi, I know this may be very simple, but it is not listed on any tutorial sites, they all have very very simple if statements, i wonder why don't they give a bit more complicated eg:
I want to have an if statement that does multiple things:
Code:
if [....] ; then
 1=...
2=...
3=....

fi
how should i surround 1-3?
i have tried {} but doesn't seem to work
Thanks,
Ted
 
Old 02-02-2011, 07:55 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,652

Rep: Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536
Just like that. Everything between 'then' and 'fi' IS the if block.
 
Old 02-02-2011, 07:58 PM   #3
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Rep: Reputation: 2
Quote:
Originally Posted by AlucardZero View Post
Just like that. Everything between 'then' and 'fi' IS the if block.
I second that. I would check the code you are using within the if statement to be sure it is correct. That is probably where your problem rests.
 
Old 02-02-2011, 07:59 PM   #4
ted_chou12
Member
 
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 421
Blog Entries: 28

Original Poster
Rep: Reputation: 2
I see, thanks!
 
  


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] How to make a C app do multiple tasks simultaneously? yaplej Programming 6 10-24-2010 08:09 AM
[SOLVED] case statement passing multiple arguments supulton Programming 2 08-07-2010 09:00 PM
[SOLVED] Find statement for multiple folder names rjo98 Linux - Newbie 15 01-21-2010 08:29 PM
How to do multiple comaprison in a IF statement pdklinux79 Linux - Newbie 4 06-11-2008 11:34 PM
semaphore with multiple tasks Rama Anandakrishnan Linux - Kernel 3 08-01-2007 07:48 PM


All times are GMT -5. The time now is 09:23 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration