I've diagnosed this problem further. It is an interaction between cygwin and a security package called "Credant Guardian Shield" that my company installs on all of its laptops. I can't say specifically that it is a cygwin bug, but this bad behavior is not present in earlier versions.
As described below, the problem is a command like "echo foo >> foo.txt" creates a file that starts with a bunch of garbage, and ends with the expected text. -- Bill -----Original Message----- From: William Lebow [mailto:william.le...@phaseforward.com] Sent: Sunday, March 07, 2010 2:58 PM To: cygwin@cygwin.com Cc: ble...@alum.mit.edu Subject: redirect-append (>>) creates garbage-y file I'm a long time cygwin user, but I am having the weirdest problem after installing on my new Dell laptop running Windows XP professional. I'd be grateful for any advice or hints from this group. I am doing a simple redirect-append (>>, that is) to create a new file. When I do this the new file has twice as many characters as I expect and the first bunch of characters are seemingly garbage. This only happens with ">>" and only if I am creating a new file. Using ">>" to append to a file is no problem. Using ">" to create a new file is not problem So far this has not been reproducable on any other PC. I am using the bash version 3.2.49(23)-release (i686-pc-wygwin) , with the 1007.1.0.0 cygwin1 dll-- see attached output from cygcheck. Some examples follow:: ################################# #### Example 1 #### I expect 4 characters (including the terminator); I get 7 #### The first 3 characters are unwanted $ echo abc >> test1.txt $ wc test1.txt 1 1 7 test1.txt $ cat test1.txt 0▒▒abc $ hexedit test1.txt 00000000 30 B5 A2 61 62 63 0A 0..abc. ################################# #### Example 2 #### I expect 8 characters (including the terminator); I get 15 #### The first 7 characters are unwanted $ echo abcdefg >> test2.txt $ wc test2.txt 1 1 15 test2.txt $ cat test2.txt ▒▒\zB▒▒abcdefg hexedit test2.txt 00000000 AD EB 5C 7A 42 B6 C5 61 62 63 64 65 66 67 0A ..\zB..abcdefg. ################################# #### Example 3 #### Use > instead of >> and I get exactly what I should get $ echo abc > test3.txt $ wc test3.txt 1 1 4 test3.txt $ cat test3.txt abc Many thanks for any help -- Bill -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple