, please use ***[code][/code]
tags*** around your code and data, to preserve formatting and to improve readability. Please do not
use quote tags, colors, or other fancy formatting.
It's also generally better to not reopen old threads unless you have something specific to add to that
discussion. Otherwise, open up a new thread for your questions, and link back to the other if appropriate.
I don't like the idea of using so many conditions in a single test anyway. It would be more robust, readable, easily debuggable, and likely more efficient, to break it up into multiple nested tests instead.
if [[ $VAK = "NOS" && $TYPE = "LES" ]]; then
if [[ $ONDERWERP = "BEVEILIGING" && $ACTIE = "UITVOEREN" ]]; then
echo "UITVOEREN NOS LES firewall"
Of course, too many nested levels can be unwieldy as well, so two conditions per test seems like a good balance to me.
And as per the previous comments, when using bash
, it's recommended to use ((..))
for numerical tests, and [[..]]
for string/file tests and complex expressions. Avoid using the old [..]
test unless you specifically need POSIX-style portability.
Finally, depending on your exact requirements, it might also be a good idea to look into using case
statements, either in combination with, or instead of, if