Examination of pipes in the Windows shell cmd.exe:
C:\>feed | filter
The standard exit from the feed process does not seem to reach the standard input of the filter process until AFTER the feed process is completed.
This type of "buffering" can cause annoying delays in the output messages for lengthy feed processes (where you can press "ctrl-c" to abort it in case of an early error).
Is there a way to avoid this so that the standard output from the feed process reaches the standard input in the filtering process as soon as the data is available? (without buffering)
For example, the following simplified example:
feed.bat:
@echo off
echo something
sleep 3
echo something else
filter.bat:
@echo off
for /F "tokens=*" %%a in ('more') do (
echo _%%a
)
, 3 ( ):
C:\>feed | filter
_something
_something else
, "_something", 3- , "_something else".