Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Trapping Strange Output

Expand Messages
  • merlyn@stonehenge.com
    ... Joe But when I run it through ssh, it doesn t return any output. Here are the Joe following variations that I ve tried and each time I get nothing. The
    Message 1 of 6 , Apr 1, 2004
    • 0 Attachment
      >>>>> "Joe" == Joe Catanzaro <joecatanzaro@...> writes:

      Joe> But when I run it through ssh, it doesn't return any output. Here are the
      Joe> following variations that I've tried and each time I get nothing.

      The "." command is a shell builtin. If it is accepting redirects,
      those are likely running the command in a subshell, not a shell, and
      you're not getting the right results.

      Try something like:

      ssh user1@box1 -n "(. XXX; . YYY; /home/blah ) 2>&1"

      Note the parens around all three commands.


      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    • Joe Catanzaro
      ... Randal, Thanks for your response, but I m getting the same results. The fixer program in my example: /home/superuser/fixer/fixer 78758000002063 002 X is a
      Message 2 of 6 , Apr 1, 2004
      • 0 Attachment
        At 4/1/2004 11:05 AM Thursday, merlyn@... wrote:
        >Try something like:
        >
        >ssh user1@box1 -n "(. XXX; . YYY; /home/blah ) 2>&1"

        Randal,

        Thanks for your response, but I'm getting the same results. The fixer
        program in my example:

        /home/superuser/fixer/fixer 78758000002063 002 X

        is a C program. When I attempt to break it in different ways, I get
        different results. Sometimes I'm able to trap my output, but this time I
        get nothing.





        Joe Catanzaro
        joecatanzaro@...
      • merlyn@stonehenge.com
        ... Ahh! What s your shell on the remote box? If it s not /bin/sh (the One True Shell), that syntax doesn t work. I forgot that about ssh. Sorry. -- Randal
        Message 3 of 6 , Apr 1, 2004
        • 0 Attachment
          >>>>> "Joe" == Joe Catanzaro <joecatanzaro@...> writes:

          Joe> At 4/1/2004 11:05 AM Thursday, merlyn@... wrote:
          >> Try something like:
          >>
          >> ssh user1@box1 -n "(. XXX; . YYY; /home/blah ) 2>&1"

          Ahh! What's your shell on the remote box? If it's not /bin/sh
          (the One True Shell), that syntax doesn't work.

          I forgot that about ssh. Sorry.

          --
          Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
          <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
          Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
          See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
        • Joe Catanzaro
          ... user1 echo $SHELL /usr/bin/ksh and that s being set in the first command that s listed in my ssh string when I execute .profile. So, my first thought is
          Message 4 of 6 , Apr 1, 2004
          • 0 Attachment
            At 4/1/2004 11:50 AM Thursday, merlyn@... wrote:
            >Ahh! What's your shell on the remote box? If it's not /bin/sh
            >(the One True Shell), that syntax doesn't work.

            user1 > echo $SHELL
            /usr/bin/ksh

            and that's being set in the first command that's listed in my ssh string
            when I execute .profile. So, my first thought is to add something
            like export SHELL=/usr/bin/sh but that doesn't make sense. What do
            you suggest?


            Joe Catanzaro
            joecatanzaro@...
          • Joe Catanzaro
            My problem was eventually tipped off by Tom of the Omaha Linux User Group with the following post: To: Omaha Linux User Group Subject: Re:
            Message 5 of 6 , Apr 1, 2004
            • 0 Attachment
              My problem was eventually tipped off by Tom of the Omaha Linux User Group
              with the following post:

              To: Omaha Linux User Group <olug@...>
              Subject: Re: [olug] Trapping Strange Output

              Some applications will not write to stdout, but to /dev/tty. Perhaps you
              need to
              use the -t option on ssh.

              Tom Roehr

              And here's the man page listing:

              -t Force pseudo-tty allocation. This can be used to execute arbiĀ­
              trary screen-based programs on a remote machine, which can be
              very useful, e.g., when implementing menu services. Multiple -t
              options force tty allocation, even if ssh has no local tty.

              Thanks again everyone.

              At 4/1/2004 12:07 PM Thursday, Joe Catanzaro wrote:
              >At 4/1/2004 11:50 AM Thursday, merlyn@... wrote:
              > >Ahh! What's your shell on the remote box? If it's not /bin/sh
              > >(the One True Shell), that syntax doesn't work.
              >
              >user1 > echo $SHELL
              >/usr/bin/ksh
              >
              >and that's being set in the first command that's listed in my ssh string
              >when I execute .profile. So, my first thought is to add something
              >like export SHELL=/usr/bin/sh but that doesn't make sense. What do
              >you suggest?


              Joe Catanzaro
              joecatanzaro@...

              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.