Shell Scripting – Checking Conditions with if

You may also like...

3 Responses

  1. Tomas says:

    I’d suggest you to surround variables with “” by default, because if $number isn’t declared or has a space in it, bash will throw a syntax error.

  2. RoseHosting says:

    In bash scripting double brackets “[[” are generally safer to use and support extra operations.

  3. Pard says:

    You don’t need to use the bracket, if works without them, it’s a statement to check if the condition is true

Leave a Reply

Your email address will not be published. Required fields are marked *