Skip Menu |

This queue is for tickets about the Net-SSH-Expect CPAN distribution.

Report information
The Basics
Id: 30841
Status: open
Priority: 0/
Queue: Net-SSH-Expect

People
Owner: Nobody in particular
Requestors: klw71 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Escape characters returned in results from SSH Expect...
Date: Mon, 19 Nov 2007 02:10:27 -0800 (PST)
To: bug-Net-SSH-Expect [...] rt.cpan.org
From: Kevin Wriston <klw71 [...] yahoo.com>
Results returned from the SSH Expect include escaped character sequences. I've enclosed some code and output to show you how this looks... Thanks, Kevin -- $cmd = $ssh->exec("ls $remotedir"); #print "cmd=$cmd\n"; $chr = chr(13); my @lines = split(/$chr/, $cmd); #print "lines = " . @lines . ", @lines"; ## get rid of the original command on the first line and the prompt on the last line... $lines[0] = ""; $lines[@lines-1] = ""; foreach $line (@lines) { $chr = chr(10); $line = join("",split(/$chr/,$line)); #print "line = $line\n"; ##klwr - this won't work for files with spaces... my @files = split(/ /, $line); foreach $filename (@files) { if ($filename ne "") { my @chars = split(//,$filename); foreach $char (@chars) { print "$char (" . ord($char) . ")\n"; } print "file = $filename\n"; push(@results, "$filename"); } } } --  (27) [ (91) 0 (48) 1 (49) ; (59) 3 (51) 2 (50) m (109) p (112) a (97) s (115) s (115) i (105) v (118) e (101) z (122) e (101) k (107) a (97) y (121) i (105) . (46) p (112) l (108)  (27) [ (91) 0 (48) 0 (48) m (109) file = passivezekayi.pl
Kevin, can you explain for me what is this bug? How does it affect your normal tasks? Can you show me a simple example of something that should work ok but it's ot ok because of this issue you found? i'm finding hard to understand all the tricks you're doing with the characters in the example you gave me. regards, bruno On Mon Nov 19 05:11:42 2007, klw71@yahoo.com wrote: Show quoted text
> Results returned from the SSH Expect include escaped character > sequences. I've enclosed some code and output to show you how this > looks... > > Thanks, > Kevin > > -- > > $cmd = $ssh->exec("ls $remotedir"); > #print "cmd=$cmd\n"; > > $chr = chr(13); > my @lines = split(/$chr/, $cmd); > #print "lines = " . @lines . ", @lines"; > > ## get rid of the original command on the first line and the prompt > on the last line... > $lines[0] = ""; > $lines[@lines-1] = ""; > foreach $line (@lines) { > $chr = chr(10); > $line = join("",split(/$chr/,$line)); > #print "line = $line\n"; > > ##klwr - this won't work for files with spaces... > my @files = split(/ /, $line); > > foreach $filename (@files) { > if ($filename ne "") { > my @chars = split(//,$filename); > foreach $char (@chars) { > print "$char (" . ord($char) . ")\n"; > } > > print "file = $filename\n"; > push(@results, "$filename"); > } > } > } > > -- > >  (27) > [ (91) > 0 (48) > 1 (49) > ; (59) > 3 (51) > 2 (50) > m (109) > p (112) > a (97) > s (115) > s (115) > i (105) > v (118) > e (101) > z (122) > e (101) > k (107) > a (97) > y (121) > i (105) > . (46) > p (112) > l (108) >  (27) > [ (91) > 0 (48) > 0 (48) > m (109) > file = passivezekayi.pl >