Relevance syntax issue

(imported topic written by jrbast)

What’s wrong with this relevance? Running each if manually works just fine generating a true answer for the first and false for the second for the no existance of the “status” file. I need this whole relevance to return true if the first condition is true.

if (not exist (operating system) whose (it as string as lowercase contains “win” ) and exist file “/opt/dseries/WA/agentparm.txt” and not exist file “/opt/dseries/WA/status”)

then

true

else

 if (exist file "/opt/dseries/WA/status" and exist line whose ( it contains "Inactive" ) of file "/opt/dseries/WA/status")

 then

     true

 else

    false

else

false

(imported comment written by amelgares)

It looks like you have an extra else at the end. Here is your structure:

if (xxx)

then

else
if (xx)
then
else

else <–extra else

(imported comment written by jrbast)

That last else if for the first if, get syntax error if it’s removed.

Remember, i want the result of the first “if” to return true else check second “if” returning true/false, else false

So if the first if is true then i’m done and should never do the second “if”

(imported comment written by jrbast)

if (not exist (operating system) whose (it as string as lowercase contains “win” ) and exist file “/opt/dseries/WA/agentparm.txt” and not exist file “/opt/dseries/WA/status”) then true else if (exist file “/opt/dseries/WA/status” and exist line whose ( it contains “Inactive” ) of file “/opt/dseries/WA/status”) then true else false

Resolved