I am trying to output text with *nix line endings from a windows dart vm, and it seems to be always replacing the \n with \r\n:
#!/usr/bin/env dart
# foo.dart
import 'dart:io';
main() {
stdout.write('a\nb\nc\n');
stdout.write('a\x0Ab\x0Ac\x0A');
}
Here's what I get when running from cygwin
$ foo.dart | foo.txt
$ cat -A foo.txt
a^M$
b^M$
c^M$
a^M$
b^M$
c^M$
Is there a way to output text without automatic carriage returns insertion?