Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用批处理执行 perl 正则表达式命令,例如:
perl -p -e "<my regex>" c:\file.txt PAUSE
我如何告诉 perl 将其作为可验证返回,然后使用批处理回显打印结果?
@echo off for /f "delims=" %%q in ('perl -e"print q{a b c}"') do set var=%%q echo %var% pause
或者
@echo off for /f "usebackq delims=" %%q in (`perl -e"print 'a b c'"`) do set var=%%q echo %var% pause