Shell Scripting Tutorial for Beginners 5 If Statement ( If then, If then else, If elif else)
For more detailed Tutorial visit Conditionals let us decide whether to perform an action or not, this decision is taken by evaluating an expression. Expressions An expression can be: String comparison, Numeric comparison, File operators and Logical operators and it is represented by expression: String Comparisons: compare if two strings are equal compare if two strings are not equal n evaluate if string length is greater than zero z evaluate if string length is equal to zero Examples: s1 s2 (true if s1 same as s2, else false) s1 s2 (true if s1 not same as s2, else false) s1 (true if s1 is not empty, else false) n s1 (true if s1 has a length greater then 0, else false) z s2 (tru. .., ProgrammingKnowledge, BourneShellandProgramming, Bashscripting, Unix, Tutorials, Learning, Operating, System, OS, Beginners 20170306 OO2Avn1g5Tw
|