[olug] Trapping Strange Output
Joe Catanzaro
joecatanzaro at cox.net
Thu Apr 1 16:00:12 UTC 2004
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
More information about the OLUG
mailing list