NO

Author Topic: xargs for Windows  (Read 4777 times)

Offline Vortex

  • Member
  • *
  • Posts: 864
    • http://www.vortex.masmcode.com
xargs for Windows
« on: February 12, 2023, 11:40:34 AM »
What's xargs?

Quote
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.

https://en.wikipedia.org/wiki/Xargs

Windows xargs clone: PPX2

https://github.com/ghuls/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: 860
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