If … else

Home of the ABS programming language: the joy of shell scripting.


If … else

ABS supports basic if statements:

if x > 0 {
    echo("hello world")
}

as well as else alternatives:

if x > 0 {
    echo("hello world")
} else {
    echo("hello globe")
}

You can wrap conditions in parenthesis, although we believe that, from a readability standpoint, it’s usually better to omit them:

if (x > 0) {
    echo("hello world")
}

Note that else if clauses are not supported, although they are planned (see #27).

Next

That’s about it for this section!

You can now head over to read about for loops.