John Doe
John Doe

Reputation: 1869

Batch file &gt meaning

I've found a batch script online that does a thing similar to a task needed in the company I'm in. Now, I'm trying to modify this script to suit our needs but I've come across some unusual symbols. Here is one of the lines that I don't understand:

ECHO Comment %FOO% comment  >>%LOG_FILE% 2>&1

I'm not very good at batch scripting but from what I understand this line should save the first comment, then the content of the variable "FOO", then the second comment in a log file with name "LOG_FILE". The thing I'm not understanding is the meaning of &gt and &amp, I thought that &gt meant > but replacing it the batch file will crash.

What should i put instead of &gt and &amp to make the file work? Right now i get that &gt and &amp are not recognized as an internal or external command, operable program or batch file.

EDIT: this is not part of an XML, that's what had me scratching my head

Upvotes: 0

Views: 2155

Answers (1)

npocmaka
npocmaka

Reputation: 57252

ECHO Comment %FOO% comment  >>%LOG_FILE% 2>&1

this is the code of the batch you've posted. But probably it was embedded in xml and > and & were encoded with xml entities. >>%LOG_FILE% 2>&1 just means append all output to the log file and redirect error output to the standard output.

Upvotes: 1

Related Questions