If I want to run the command
md5deep -rb . | find /I ".jpg" | sort > local.md5
and I run it from the command prompt, it shows exactly like how I typed, but when I put it in a .bat file and run that, this is what I see:
md5deep -rb . | find /I ".jpg" | sort 1>local.md5
It seems that it inserts tabs before |
and it turns >
into a 1>
. Why? First I thought that it's something to do with the encoding, but the file is just a simple ANSI file.
Does it have anything to do with @@
turning @
inside .bat files?
It's nothing to worry about. It's just the way the Windows
CMD
parser outputs the lines when you don't suppress the "trace" output using:or
I'm not sure what you're referring to regarding
@@
versus@
(except for possibly the above). I don't know of anything special about@@
, unless you're confusing it with%%
versus%
for variable names.The 1> refers to how standard out is being redirected within the bat file.
You have two channels, one for standard out (1>), and one for standard error out (2>). They use either 1> or 2> for processing, and provide two different types of execution feedback. I have this list for different redirection permutations:
This is from Rob van der Woude's excellent web site on Win32 scripting: http://www.robvanderwoude.com/redirection.php
Rob