Click here to get back home

Sending commands to a secondary prompt

 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
Sending commands to a secondary prompt sanjeeb 02-19-2007
Get Chitika Premium
Posted by sanjeeb on February 19, 2007, 7:29 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 Mark Clements on February 19, 2007, 2:52 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
Sending commands to new shell in Perl June 2, 2005, 2:34 pm
Is there a name for secondary or derived properties? July 6, 2005, 10:33 pm
IO::Prompt with Keymap October 10, 2006, 8:10 am
Net::Telnet prompt problem April 13, 2005, 1:22 pm
Windows shortcut without dos prompt August 3, 2005, 2:29 pm
"cpan" command prompt on Mac OS X May 10, 2006, 5:04 pm
how to automate userinteractive prompt May 24, 2007, 10:01 am
Net::SSH::Perl -- can I capture the command prompt? November 14, 2006, 9:33 pm
Question on input password on ssh prompt September 15, 2007, 6:20 pm
Change the net:telnet prompt durring runtime. March 16, 2005, 8:33 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap