I wanted to make a batch file to print the value of a variable by passing the name of variable through the command line argument ex.
print.bat username
the content of print.bat are
@echo off
setlocal
set v=%%%1%%%
echo | echo %v%
Although the script is working perfectly but I still don't understand the working of
echo | echo %v%
My understanding of the pipes is that the output of first command (i.e. command at the left side of pipe operator) is passed to the second command (i.e. the command to the right of pipe operator) so according to this the correct way should have been echo %v% | echo (which does not work).
Can anybody explain this behavior?
Thanks