From: Achim S. <Ach...@mn...> - 2004-12-07 10:26:03
|
Hi John, Am Dienstag, 7. Dezember 2004 02:28 schrieb John Clizbe: > Oops, forgot to include that unix2dos.exe is part of MinGW, but the perl > one-liner does it entirely within MSYS. Take your pick. Hmmh - it's part of the supplementary packages. But sadly - at least at one WinXP installation the contained unix2dos version didn't work right, at least if called from MSYS shell script ( endlees operation, no result ). Perl was also one of my ideas - but it's also not part of the core. And I didn't find an MSYS perl in one of the supplementary packages. The independend perl, which I tried, was not automatically detected by MSYS. As even the tr method, which was suggested by Greg, doesn't manage to get \r written in a file, I suspect that at least my MSYS installation automatically erases any \r from file pipes. Bye, Achim > > John Clizbe wrote: > > Achim Spangler wrote: > >>> Hi, > >>> I have a script, which is used to create a DSP file for Microsoft > >>> Visual Studio ( VC++ 6.0 ). Everything works fine, if I call the script > >>> in LINUX and copy then the DSP file to Win32. > >>> > >>> But if I call the script in MSYS, the implicit conversion of all files > >>> to UNIX linefeed inhibit the correct load of the DSP in VC++. The sed > >>> oneliner (part of the script): > >>> > >>> sed -e 's/$/\r/' Infile> Outfile > >>> > >>> does only work in LINUX. > >>> > >>> Question: > >>> How can I do the UNIX-->Win32 Linefeed converion within MSYS? > > > > unix2dos ? > > > > cat > unix2dos << EOF > > #!/bin/sh > > # > > # Bergman's second conjecture: Any sufficiently useful one-line Perl > > # program is indistinguishable by a non-programmer from line noise. > > # > > exec perl -w -e 'while (<>) { chomp; print "$_", (/\r$/ ? "\n" : "\r\n"); > > }' EOF > > > > One line -- may wrap in mail > > > > > > -- > > John P. Clizbe Inet: JPClizbe(a)comcast DOT nyet > > Golden Bear Networks PGP/GPG KeyID: 0x608D2A10 > > "Be who you are and say what you feel because those who mind don't matter > > and those who matter don't mind." - Dr Seuss, "Oh the Places You'll Go" |