Skip to content

Instantly share code, notes, and snippets.

@breezhang
Created April 28, 2014 02:19
Show Gist options
  • Save breezhang/11360350 to your computer and use it in GitHub Desktop.
Save breezhang/11360350 to your computer and use it in GitHub Desktop.
ack Multi Path search some stuff for win32 cmd script
@echo off & setlocal
setlocal EnableDelayedExpansion
set t=%path%
:loop
for /f "tokens=1* delims=;" %%a in ("%t%") do (
set tt=%%a
set ttt=!tt:~-1!
set tttt=!tt:~0,-1!
IF "%ttt%"=="\" (
rem IF EXIST "%tttt%" echo "OK"
cmd /c ack -f --perl "%tttt%"
) else (
IF "%tt%" NEQ "" echo %tt%
)
set t=%%b
)
if defined t goto :loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment