The Logical OR "||" is a boolean operator that executes following commands based on the outcome of previously executed commands.
Logical OR (||) if [[expr1 ||expr2]] Returns expr1 if it can be converted to false; otherwise, returns expr2. Thus, when used with Boolean values, && returns true if one operand is true; otherwise, returns false.
for using And operator use ||
if [ "$age" -gt 18] || ["$age" -lt 30 ]
The -o option provide an alternative compound condition test.
if [ "$age" -gt 18 -o "$age" -lt 30 ]
if [[ $condition1 || $condition2 ]] # Also works.
if [[ "$age" -gt 18 || "$age" -lt 30 ]]
En esta página del sitio puede ver el video en línea 09. Shell Scripting Tutorial for Beginners - Logical 'OR' Operator de Duración hora minuto segunda en buena calidad , que subió el usuario MyShadowbook Programmer 05 septiembre 2017, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 16 veces y le gustó 0 a los espectadores. Disfruta viendo!