SysAdmin

Shell Script – Multiple Conditions In single if statement

JJ
Jobin Joseph · Founder and CEO
·Published 8 July 2013·1 min read

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“`

Jobin Joseph
Jobin Joseph, Founder and CEO
5x AWS Certified, ISO 27001:2022 Lead Implementer, 17+ years building cloud infrastructure for regulated industries.
About Jobin →

Reading this because your AWS bill or uptime is a problem?

30 minutes, direct with the founder, no sales pitch: one specific recommendation for your AWS workload.

Book a free 30-minute review
30 min Free Consultation →