minus-squaresuff@piefed.socialtoLinux@lemmy.ml•Check two conditions in bash ? [solved]linkfedilinkEnglisharrow-up3·edit-22 months agoExplanation [ is an alias for the program test, so you can call man test for more info. && is bash syntax for conjunction. In A && B, B will only be called if A returned a exit code >0 (error). You can call man bash for more info. || is bash syntax for disjunction. In A || B, B will only be called if A returned exit code =0 (success). true and false are programs that just return exit codes 0 respectively 1. linkfedilink
Explanation
[is an alias for the programtest, so you can callman testfor more info.&&is bash syntax for conjunction. In A && B, B will only be called if A returned a exit code >0 (error). You can callman bashfor more info.||is bash syntax for disjunction. In A || B, B will only be called if A returned exit code =0 (success).trueandfalseare programs that just return exit codes 0 respectively 1.