I'm executing a perl regex command using batch like:
perl -p -e "<my regex>" c:\file.txt
PAUSE
How can I tell perl to return it as a veriable and then print the result using batch echo?
I'm executing a perl regex command using batch like:
perl -p -e "<my regex>" c:\file.txt
PAUSE
How can I tell perl to return it as a veriable and then print the result using batch echo?
@echo off
for /f "delims=" %%q in ('perl -e"print q{a b c}"') do set var=%%q
echo %var%
pause
or
@echo off
for /f "usebackq delims=" %%q in (`perl -e"print 'a b c'"`) do set var=%%q
echo %var%
pause