I'm new to bash script programming and i need to make some of my own loop programs. Can anyone help me with it? Bash script if then else help, this is what i need, can anyone help with some examples...
I'm new to bash script programming and i need to make some of my own loop programs. Can anyone help me with it? Bash script if then else help, this is what i need, can anyone help with some examples...
The syntax for If Then Else is as follows :
You can try and implement it in your program. See what you get...Code:if [condition] then <task-command-or-jump> else <task-command-or-jump> fi
Ok, thanks for the syntax but it will take me some time to get it into my head, can you give an example? Thanks! But i will need it to understand... Please help...
Try to understand this example :
Give a value to a variable 'a' which is less then 1
Give a value to a variable 'a' which is greater then 1Code:if [a>1] then print "a is greater then 1" else print "a is less then 1" fi
See the result variation and then you try to use it in your programs, it will help you...Code:if [a>1] then print "a is greater then 1" else print "a is less then 1" fi
Bookmarks