[olug] Trapping Strange Output
troehr at nj-onramp.com
troehr at nj-onramp.com
Thu Apr 1 21:37:24 UTC 2004
Some applications will not write to stdout, but to /dev/tty. Perhaps you need to
use the -t option on ssh.
Tom Roehr
Quoting Joe Catanzaro <joecatanzaro at cox.net>:
> I'm trying to trap the output of the following command.
>
> ssh -l user1 box1 -o BatchMode=yes ". /export/home/user1/.profile 2>&1
> 1>/dev/null;. /home/superuser/fixer/sync.user1.env;/home/superuser/fixer
> 78758000002063 002 X"
>
> When I run the command by itself, outside of ssh, the results are as
> follows, which is exactly what I want:
>
> user1 > . /export/home/user1/.profile 2>&1 1>/dev/null;.
> /home/superuser/fixer/sync.user1.env;/home/superuser/fixer/fixer
> 78758000002063 002 X
> GETTING CCWO DATA . . .
> PACKING GETAD DATA . . .
> sp [124]
> obj_count [61]
> data [640023710002374000078758000002063002000000000000000000000000000]
> (FLDID(3)) 0
> (FLDID(33554436)) 9
> (FLDID(201326597)) 238\1f0\1f0\1f0\1f\1f0\1f100\1f0\1f0\1f
>
> Segmentation Fault(coredump)
>
> But when I run it through ssh, it doesn't return any output. Here are the
> following variations that I've tried and each time I get nothing.
>
> ssh -l user1 box1 -o BatchMode=yes ". /export/home/user1/.profile 2>&1
> 1>/dev/null;. /home/superuser/fixer/sync.user1.env;/home/superuser/fixer
> 78758000002063 002 X 2>&1" # Trapping both STDERR and STDOUT
>
> ssh -l user1 box1 -o BatchMode=yes ". /export/home/user1/.profile 2>&1
> 1>/dev/null;. /home/superuser/fixer/sync.user1.env;/home/superuser/fixer
> 78758000002063 002 X 2>/dev/null" # Trapping STDOUT and dumping STDERR
>
> ssh -l user1 box1 -o BatchMode=yes ". /export/home/user1/.profile 2>&1
> 1>/dev/null;. /home/superuser/fixer/sync.user1.env;/home/superuser/fixer
> 78758000002063 002 X 2>&1 1>/dev/null" # Trapping STDERR and dumping
> STDOUT
>
> ssh -l user1 box1 -o BatchMode=yes ". /export/home/user1/.profile 2>&1
> 1>/dev/null;. /home/superuser/fixer/sync.user1.env;/home/superuser/fixer
> 78758000002063 002 X 3>&1 1>&2 2>&3 3>&-" # Exchanging STDERR and
> STDOUT
>
> I'm at a loss. Any input would be very appreciated.
>
> Thanks,
>
>
> Joe Catanzaro
> joecatanzaro at cox.net
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug
>
More information about the OLUG
mailing list