What would be the Windows 7 Equivalent for the following command?
find . -type f -print0 | xargs -0 sed -i 's/ url \([^" >][^ >]*\)/ url "\1"/g'
I am trying to migrate Django 1.4 to 1.5
I think that installing original tools is much better in terms of unification then rewriting everything. I personally use GOW, it still misses a tiny number of commands but contains all most needed stuff.
If you still want to hit batch programming there's a good list of all commands: http://ss64.com/nt/, I think you need forfiles
.
xargs.exe
can be found in the package findutils
from the project GnuWin
( gnuwin32.sourceforge.net/packages/findutils.htm )
Commented
Jan 7, 2020 at 13:20
Copied from here
@echo off
:: example: git branch | grep -v "develop" | xargs git branch -D
:: example xargs -a input.txt echo
:: https://helloacm.com/simple-xargs-batch-implementation-for-windows/
setlocal enabledelayedexpansion
set args=
set file='more'
:: read from file
if "%1" == "-a" (
if "%2" == "" (
echo Correct Usage: %0 -a Input.txt command
goto end
)
set file=%2
shift
shift
goto start
)
:: read from stdin
set args=%1
shift
:start
if [%1] == [] goto start1
set args=%args% %1
shift
goto start
:start1
for /F "tokens=*" %%a in (!file!) do (
%args% %%a
)
:end
In my experience only rush works correctly on Windows - it handles paths with backslashes and allows \r\n as a delimiter. Has native (non cygwin) build, can buffer and sort output.
Minimalist xargs for Windows created using pyinstaller and a short python script is available below:
TextTools (github.com) includes a Windows-native xargs clone called wargs. It supports nearly all of the GNU xargs functionality, plus options to specify the input text's encoding in case it isn't ASCII.