Channel Error w/ stdout in 5.8

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Channel Error w/ stdout in 5.8

  • Creator
    Topic
  • #53207
    Jeff Jakobowski
    Participant

      Has anyone noticed a problem using stdout in 5.8? We use many scripts that have

    Viewing 2 reply threads
    • Author
      Replies
      • #76926
        David Barr
        Participant

          Considering that I think I wrote that code I should probably comment. I played around with this and I couldn’t find an elegant way of redirecting both stderr and stdout to the process log as well as detecting the exit code of the command for error handling. Cloverleaf does funny things with the stdout and stderr file channels when you’re running in an hciengine process. The easiest way to handle this might be to redirect output to a file.

          Code:

          set errCode [catch {exec sh -c “$cmd > $tempfile 2>&1″} errMsg]
          puts -nonewline [read_file $tempfile]

        • #76927

          Hi Jeff and David. If it were me, I would not try to use stdout and stderr within the engine. Instead, I would do as David suggested and redirect output to a file.

          You could use perl to do inline find and replace and change your redirects to ” > /dev/null” perhaps? Or to a real log file?

          -- Max Drown (Infor)

        • #76928
          David Barr
          Participant

            I think the issue is that you want to be able to review the output of the command when it fails, so sending it to /dev/null wouldn’t be a good idea. A real log file would be better, but then you have to come up with a strategy for archiving the log files.

        Viewing 2 reply threads
        • The forum ‘Cloverleaf’ is closed to new topics and replies.