LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Bash Scripting (https://www.linuxquestions.org/questions/programming-9/bash-scripting-239668/)

Darklight451 10-07-2004 12:26 AM

Bash Scripting
 
How would i set up an "If then" statement using bash?

CroMagnon 10-07-2004 01:48 AM

Indented:
Code:

if [ condition ]; then
  bla
  bla
  bla
fi

or
Code:

if [ cond ]
then
  bla
  bla
  bla
fi

or all on the same line
Code:

if [ cond ]; then bla; bla; bla; fi
(edited to make things a bit more obvious)


All times are GMT -5. The time now is 10:02 PM.