Windows equivalent to xargs?

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

5 Answers

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: , I think you need forfiles.

3

Copied from here

@echo off
:: example: git branch | grep -v "develop" | xargs git branch -D
:: example xargs -a input.txt echo
::
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

Minimalist xargs for Windows created using pyinstaller and a short python script is available below:

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.

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.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like