Author Topic: xargs for Windows  (Read 340 times)

Offline Vortex

  • Member
  • *
  • Posts: 576
xargs for Windows
« on: February 12, 2023, 11:40:34 AM »
What's xargs?

xargs (short for "extended arguments" [1]) is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. It converts input from standard input into arguments to a command.

Some commands such as grep and awk can take input either as command-line arguments or from the standard input. However, others such as cp and echo can only take input as arguments, which is why xargs is necessary.

Windows xargs clone: PPX2

Some examples of usage :

Calculating the MD5 hash of a group of files under a folder :

Code: [Select]
dir /b /s /a-d D:\Folder | ppx2.exe -L 1 md5sum.exe "{}" > md5.txt
.mpg convertion :

Code: [Select]
dir /b *.mpg | ppx2 -P 4 -L 1 ffmpeg.exe -i "{}" -quality:v 1 "{}.mp4"
Attached is the project built with PellesC v11
Code it... That's all...

Offline John Z

  • Member
  • *
  • Posts: 567
Re: xargs for Windows
« Reply #1 on: February 13, 2023, 01:04:58 PM »
Hi Vortex,

Looks very interesting....

Nice to see to useful code posted, I'm sure there are things to learn from it (like 'EnterCriticalSection').

John Z