redirect-append (>>) creates garbage-y file

William Lebow William.Lebow@phaseforward.com
Mon Mar 8 02:47:00 GMT 2010


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 100710.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 test3.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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 15765 bytes
Desc: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100308/c1cb09ed/attachment.obj>
-------------- next part --------------
--
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


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /