Answers for "two conditions in if statement bash"

1

bash two if conditions

# A one liner
if [ $VAR1 -ne 0 ] && [ $VAR2 -ne 0 ]; then  
echo "your action"; 
elif [ $VAR1 -eq 0 ] && [ $VAR2 -ne 0 ]; then  
echo "more actions";  
else echo "other action"; 
fi
Posted by: Guest on November-29-2021
1

multiple conditions in if shell

if [ -f "tmp/active_arl_list" ] || [ -f "tmp/inactive_arl_list" ]
              then 
                    rm tmp/{a,b}
    fi
Posted by: Guest on August-12-2021

Code answers related to "two conditions in if statement bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language