I'm trying to compare a string called facility
to multiple possible strings to test if it is valid. The valid strings are:
auth, authpriv, daemon, cron, ftp, lpr, kern, mail, news, syslog, user, uucp, local0, ... , local7
Is there an efficient way of doing this other than:
if facility == "auth" or facility == "authpriv" ...
if facility == "auth" or "authpriv"
doesn't do what they want (it checks iffacility == "auth"
is trueor
if"authpriv"
is not an empty string). – tripleee