Anyone have any ideas as to the mechanism
Do the phase rules need to be augmented
Code: Select all
@echo on
REM This pair with | is equivalent
(echo Hello) ^| findstr /n .
(echo Hello) | findstr /n .
REM This pair with & is equivalent
(echo Hello) ^& echo World
(echo Hello) & echo World
del test.txt >nul 2>nul
REM This pair with >> is equivalent
(echo Hello) ^>^> test.txt
(echo World) >> test.txt
:: show result
type test.txt
REM This pair with && is equivalent
(echo Hello) ^&^& echo World
(echo Hello) && echo World
REM This pair with || is equivalent
(call) ^|^| echo Error
(call) || echo Error
REM But escaped operator that does not immediately follow ) does not work
(call) ^&^& echo OK ^|^| echo Error
Code: Select all
D:\test>REM This pair with | is equivalent
D:\test>(echo Hello ) | findstr /n .
1:Hello
D:\test>(echo Hello ) | findstr /n .
1:Hello
D:\test>REM This pair with & is equivalent
D:\test>(echo Hello ) & echo World
Hello
World
D:\test>(echo Hello ) & echo World
Hello
World
D:\test>del test.txt 1>nul 2>nul
D:\test>REM This pair with >> is equivalent
D:\test>(echo Hello ) 1>>test.txt
D:\test>(echo World ) 1>>test.txt
D:\test>type test.txt
Hello
World
D:\test>REM This pair with && is equivalent
D:\test>(echo Hello ) && echo World
Hello
World
D:\test>(echo Hello ) && echo World
Hello
World
D:\test>REM This pair with || is equivalent
D:\test>(call) || echo Error
Error
D:\test>(call) || echo Error
Error
D:\test>REM But escaped operator that does not immediately follow ) does not work
D:\test>(call) && echo OK || echo Error
D:\test>
Dave Benham