2 Replies Latest reply on Sep 30, 2016 9:56 AM by Shubhi Johri

    Blcli execution error "Parse error near True"

    Shubhi Johri

      We are trying to add servers from a text file to BL smart group through following blcli commands:-

       

      blcli_setoption serviceProfileName <......>

      blcli_setoption authType <.......>

      blcli_setoption roleName <.........>

      blcli_connect

      cat /var/tmp/serviceoutput.txt | while read line

      do

      blcli -v <ProfileName> -r <Role> Server setPropertyValueByName $line abc true

       

      Whil its executed via NSH job in BL its throwing error  "Parse Error near true"

        • 1. Re: Blcli execution error "Parse error near True"
          Bill Robinson

          few things:

           

          these:

          blcli_setoption serviceProfileName <......>

          blcli_setoption authType <.......>

               -> authType isn't needed since 7.4, it's always BLSSO

          blcli_setoption roleName <.........>

          blcli_connect

           

          have no effect on

          blcli ...

           

          so either use the performance commands or not.

           

          this:

          cat /var/tmp/serviceoutput.txt | while read line

          do

          blcli -v <ProfileName> -r <Role> Server setPropertyValueByName $line abc true

           

          is not complete.  you are missing the 'done' to close the while loop.  and i believe if you have the read read the file directly you avoid spinning off a subprocess.

           

           

           

          so this should look like:

           

          blcli_setoption serviceProfileName <......>

          blcli_setoption roleName <.........>

          blcli_connect

          while read line

               do

               blcli_execute Server setPropertyValueByName "${line}" abc true

          done < /var/tmp/serviceoutput.txt

           

          now if your txt file was made on a windows system or may have extra control characters in it you might want to do:

           

          blcli_setoption serviceProfileName <......>

          blcli_setoption roleName <.........>

          blcli_connect

          while read line

               do

               var="$(tr -d '[:cntrl:]' <<< "${line}")"

               blcli_execute Server setPropertyValueByName "${var}" abc true

          done < /var/tmp/serviceoutput.txt

          • 2. Re: Blcli execution error "Parse error near True"
            Shubhi Johri

            Thanks Bill !! Issue Resolved :-)