Which commands (and how) fail when pipe is used.
Posted: 14 Aug 2015 17:01
Just a simple test because I wondered what else fails. I think it does not matter if pipe is before or after these commands.And they fail the same way when are processed by FOR /F .
here's the test with I've found (putting them after the pipe makes easier the output tracking)
here's the test with I've found (putting them after the pipe makes easier the output tracking)
Code: Select all
@echo off
cls
echo start
set "checkline=if defined # echo #defined#"
break|(
:: set works but to access the variable call is needed
set "#=#"
( %%checkline%% )
echo -%#%-
call echo -%%#%%-
:: shift is not working
shift
echo %~n0
:: echo state is changed
echo
:: setlocal and endlocal are not working
setlocal enableDelayedExpansion
endlocal
:: pushd /popd are not working
pushd c:\
call echo %%cd%%
:: call/goto label are not working
goto :end
echo marker
:: cd also
cd c:\
call echo %%cd%%
:: prompt is not working (but title does)
prompt ###
call echo %%prompt%%
::path/dpath are not working
path .
call echo "%%path%%"
:: pause is not pausing
pause
:: date/time does not wait for input
date
time
)
:end
echo end
rem is working strangely when is the last command - it remarks everything
break|(
rem
echo -+-+-+-
rem
)