- May
- 62
- 1
Sometimes, when I use a
As designed? If so, why?
Bret Sutton
DO varname IN fileset
command, the output list of files includes the full filepath; sometimes not. This makes it awkward (but not really too hard) to handle the output in a consistent and clean manner. The filepath-prepending seems to be triggered by the use of regular expressions for the fileset. For example:
Code:
@ echo off
echo do file in /d"D:\TMP\" /s a*a
do file in /d"D:\TMP\" /s a*a
echo file is %file _cwd is %_cwd
enddo
echo.
echo do file in /d"D:\TMP\" /s "::^a.*a$"
do file in /d"D:\TMP\" /s "::^a.*a$"
echo file is %file _cwd is %_cwd
enddo
Code:
[04:59:51 D:\] test_do
do file in /d"D:\TMP\" /s a*a
file is aportala _cwd is D:\TMP
file is atunea _cwd is D:\TMP
file is aportala _cwd is D:\TMP\foo
file is atunea _cwd is D:\TMP\foo
do file in /d"D:\TMP\" /s "::^a.*a$"
file is D:\TMP\aportala _cwd is D:\TMP
file is D:\TMP\atunea _cwd is D:\TMP
file is D:\TMP\foo\aportala _cwd is D:\TMP\foo
file is D:\TMP\foo\atunea _cwd is D:\TMP\foo
As designed? If so, why?
Bret Sutton