LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   if statement with multiple tasks (http://www.linuxquestions.org/questions/linux-newbie-8/if-statement-with-multiple-tasks-860337/)

ted_chou12 02-02-2011 06:53 PM

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

AlucardZero 02-02-2011 06:55 PM

Just like that. Everything between 'then' and 'fi' IS the if block.

flipjarg 02-02-2011 06:58 PM

Quote:

Originally Posted by AlucardZero (Post 4246478)
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.

ted_chou12 02-02-2011 06:59 PM

I see, thanks!


All times are GMT -5. The time now is 10:47 AM.