Shell Script – Multiple Conditions In single if statement

08. July 2013 SysAdmin 0

This is how you can use multiple conditions in single if statement,
“`
#!/bin/bash


if [[ ( “$user” != “condition1” ) && ( “$user” != “condition2” ) && ( “$user” != “condition3” ) ]] ; then


echo “woohoo, its working”


fi


done“`


Leave a Reply

Your email address will not be published.