Click here to get back home

more backup script problems!?!

 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
more backup script problems!?! Dan 02-23-2005
Get Chitika Premium
Posted by Dan on February 23, 2005, 5:32 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 Anno Siegel on February 23, 2005, 2:28 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
Starting Point for backup script January 28, 2005, 3:16 am
backup via ftp, depth copy, script already out there? October 27, 2006, 9:09 am
Help with script to get backup log status on windows systems July 19, 2006, 11:58 am
Perl Script Problems January 24, 2005, 3:46 am
picture upload script problems. PLEASE HELP! September 19, 2004, 1:02 am
how to purge backup files May 10, 2005, 12:43 am
backup utility for remote hosts October 20, 2004, 10:52 am
How to unzip backup files of RaQ4 server? August 24, 2004, 2:45 pm
LWP problems July 11, 2005, 8:04 pm
LWP-problems December 13, 2005, 2:14 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap