Javatpoint Logo

91-9990449935

 0120-4256464

Javatpoint Logo

Shell Scripting if then elif

A new if can be nested inside an elif.

Syntax:

Syntax of if then elif is shown in the snapshot below,

Shell scripting If then elif 1

Example if then elif:

We have shown the example of choosing color.

Condition:

Shell scripting If then elif 2

Look at the above snapshot, we have shown the script.

Shell scripting If then elif 3

Look at the above snapshot, on Red color it goes to if part, on Blue color it goes to elif part and on other colors it goes to else part.

Next Topicfor loop




Latest 4 Tutorials on JavaTpoint