Why does this batch file generate additional, unexpected, unwanted characters?

I am trying to use the following batch script to merge some files together:

copy NUL bin\translate.js
for %%f in (source\Libraries\sprintf.js, source\translate-namespace.js, source\util.js, source\translator.js, source\translate.js) do (
    type %%f >> bin\translate.js
    echo. >> bin\translate.js
)

However, when I do this, an extra character seems to be printed at the end of each file. When I view a file in ASCII, it is interpreted as these three characters: ï "¿

Why is this happening? What can I do to fix this?

+3
source share
2 answers

ï "¿ . , ? - , .

+1

DOS copy UNIX cat. , +.

copy source\Libraries\sprintf.js+source\translate-namespace.js bin\translate.js
0

Source: https://habr.com/ru/post/1771322/


All Articles