#205 Extra ^M from the echo command

0.85
closed-fixed
Gert Driesen
Core (183)
5
2004-08-27
2004-08-27
Patrick Wagstrom
No

Prefix: this is from the nightly build from August 25th
with Mono 1.0 on Fedora Core 1.

It appears when tasks are run that use the echo command
that there are extra ^M characters at the end of every
line. While on windows this makes no difference, it
can be very bad on Linux. For example, the Nant build
script includes the following commands:

<echo file="${path::combine(install.bindir,
'nant')}">
#!/bin/sh

exec ${path::combine(prefix, 'bin')}/mono
${path::combine(install.copylocation, 'bin')}/NAnt.exe "$@"
</echo>

Which should generate a nice little shell script to run
Nant without having to type "mono NAnt.exe", however,
that does not appear to be the case. Instead the
following script is generated

--START--
^M
#!/bin/sh^M
^M
exec /usr/bin/mono share/NAnt/bin/NAnt.exe "$@"^M
ииииииии
--END--

The 'и' characters represent blank spaces on the final
line. Running this script produces errors on linux.

So there are two things that need to be done, first
with the echo command, don't spit out ^M characters on
platforms that don't use them (I shudder to think what
would happen to Mono on OSX). Secondly, the #!/bin/sh
should appear immediately after the start of the echo
command, not on a new line. This will prevent the
blank line at the top.

Discussion

  • Gert Driesen
    Gert Driesen
    2004-08-27

    Logged In: YES
    user_id=707851

    This is now fixed in cvs.

     
  • Gert Driesen
    Gert Driesen
    2004-08-27

    • assigned_to: nobody --> drieseng
    • status: open --> closed-fixed