4 Replies Latest reply on Jul 25, 2014 2:16 AM by Stanley Hillner

    Weirdness with if-then-else in jboss-cli on Wildfly 8.1.0

    Russell Nile Newbie

      I am running a cli script and it seems to be ignoring the "else".  Try this:

      ****************************************************************************

      connect

      if (outcome == success) of /system-property=ENV:read-resource

       

        echo "If block"

        /system-property=ENV:read-resource

      else

       

       

        echo "Else block"

        /system-property=ENV:read-resource

       

      end-if

       

      echo "out"

      ****************************************************************************

       

      If runs both blocks every time:

      ****************************************************************************

      "If block"

      "Else block"

      "out"

      ****************************************************************************

      Is that just me?


      Also; if you don't put any operation in the block other than the echo you get a "If block is empty" and the script exits with an errorcode=1.