Menu

#145 FreeCom: file redirection and REM statement

None
closed
Jim Hall
5
2016-10-29
2016-02-04
No

FreeCom version 0.84-pre2 seems to have a problem with file redirection.

Consider the following batch file "t.bat":

echo TEST1 > test1
rem echo TEST2 > test2
echo TEST3 > test3

Executing the "t.bat" batch file results in the two files "test1" + "test3" of size 8, but there is also a "test2" file of size 0.

The same test works correctly in 4DOS; there is no "test2" file created.

Discussion

  • Anthony Williams

    This behavior is well known and similar to old MS-DOS era command.com, which (IIRC) performed the same. It's not quite useful for much, but it was used whenever someone wanted a zero-byte file. I'm aware that XP's cmd (et al.) and 4DOS don't bother to support it, but I'm not surprised, it's a weird quirk.

    If you want to comment out a line with redirection symbols ( '>','<','|' ), try "::" instead of "REM".

     
  • David Müller

    David Müller - 2016-02-05

    Thanks for your detailed answer. I wasn't aware that this is backwards compatibility feature.
    Sorry for the noise.

     
  • Jim Hall

    Jim Hall - 2016-10-29

    I'll go ahead and close this ticket since correct behavior was reflected here.

     
  • Jim Hall

    Jim Hall - 2016-10-29
    • summary: FreeCom: --> FreeCom: file redirection and REM statement
    • status: open --> closed
    • assigned_to: Jim Hall
    • Group: -->
     
  • Jim Hall

    Jim Hall - 2016-10-29

    (closed)

     

Log in to post a comment.