Click here to get back home

perl ssh with timeout?

 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
perl ssh with timeout? Markus Dehmann 03-19-2006
Get Chitika Premium
Posted by Markus Dehmann on March 19, 2006, 11:50 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

Posted by Rick Scott on March 19, 2006, 6:18 pm
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
Session Timeout in Perl June 5, 2006, 5:23 am
Perl socket timeout September 5, 2006, 12:22 am
Perl script timeout problem February 17, 2005, 10:53 am
Perl redirection to browser timeout ... November 17, 2006, 8:37 am
How to set DBI connection timeout for Win32 Perl->MySQL ? October 13, 2007, 11:44 am
handling hanging database connections: timeout in perl November 24, 2006, 8:06 am
How do I set timeout in Net::HTTP? January 25, 2006, 7:43 pm
How do I set timeout in Net::HTTP? January 25, 2006, 7:43 pm
How do I set timeout in Net::HTTP? January 25, 2006, 7:43 pm
How do I set timeout in Net::HTTP? January 25, 2006, 7:43 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap