The examples and explanations in this page are leaving me confused:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true
Is there any practical difference between using 2<&1 and 2>&1? The second form (2>&1) is familiar to me, from working with the Unix shell.
The page linked above has:
To find File.txt, and then redirect handle 1 (that is, STDOUT) and handle 2 (that is, STDERR) to the Search.txt, type:
findfile file.txt>search.txt 2<&1
and also
To redirect all of the output, including handle 2 (that is, STDERR), from the ipconfig command to handle 1 (that is, STDOUT), and then redirect the ouput to Output.log, type:
ipconfig.exe>>output.log 2>&1
In the end, is there any difference in the results?
DOS is a single tasking, single user and is CLI based OS whereas Windows is a multitasking, multiuser and GUI based OS.
A major difference between Windows 11 and Windows 10 is in its design. Windows 11 offers an interface that's more like a Mac, with pastel colors, rounded corners for all windows and a cleaner interface than its predecessor.
Some examples should show what happens:
c:\YourDir> cd FolderNotHere > nul
The system cannot find the path specified.
You get the error stream
c:\YourDir>cd FolderNotHere > nul 2>&1
You get nothing, the error stream goes to the std output stream which goes to null.
c:\YourDir>cd > nul
You get nothing, the output stream goes to null.
c:\YourDir>cd > nul 1>&2
c:\YourDir
You get the std outout which has been sent to the error stream so it doesn't get redirected.
c:\YourDir>cd > nul 1<&2
This seams to do the same as 1>&2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With