Click here to get back home

Using SSH and Expect to return STDOUT output from a C executable

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Using SSH and Expect to return STDOUT output from a C executable jrpfinch 05-09-2007
Get Chitika Premium
Posted by jrpfinch on May 9, 2007, 11:22 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
expect.pm - stdout buffering issue September 23, 2008, 6:35 am
Net::SSH::Perl sending output to STDOUT January 26, 2005, 11:45 am
sending output to STDOUT or a file April 22, 2008, 2:26 pm
I want to output all of my STDOUT to a single line....dont want to scroll September 11, 2006, 3:37 pm
SSH Module: Accessing CLI box using SSH and not getting the return output?? November 12, 2006, 11:44 pm
copy stdout fails with permission denied when stdout is redirected December 7, 2005, 1:15 pm
executable perl man pages December 2, 2004, 8:16 am
You must specify the PHP executable used for the debug session January 20, 2007, 4:46 pm
Compiled perl executable July 7, 2008, 10:52 pm
Perl Executable and Script Name -- NOT Args November 29, 2004, 9:02 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap