Simple xargs replacement for Windows Shell

in #busy5 years ago

image.png

xargs builds the command from the standard input - however, it is not available for Windows command shell... therefore I 've decided to build one and it turns out a Batch script is enough...

Source: https://github.com/DoctorLai/BatchUtils/blob/master/xargs.cmd

@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

Building command from standard input:
image.png

Building command from text file:
image.png

Reposted to blog: https://helloacm.com/simple-xargs-batch-implementation-for-windows/


Enjoy and Steem On!

Delegate to @justyy

@justyy runs a automatic delegation service for nearly a year now. Delegate to @justyy for at least 5 SP and start receiving daily payout as interests (from 8% to 10% APR). Also, as a supporter, the delegators will start to receive complimentary/curation upvotes (as a thank you) per day from e.g @justyy and a few other curation trails. For more information, read this. The voting weight algorithm is open source.

image.png

Please note that the SP you enter is the final amount to delegate. For example, if you already delegate 10 SP and you want to delegate another 5 SP, you will need to enter 15 SP (instead of 5 SP) in the delegation form.

Vote for me or Set me as a witness Proxy - Every vote counts! - Thank you!

Your Vote is much appreciated, and every vote counts.

Check out My Witness Page

Support me and my work as a witness - witness thread by

  1. voting me here, or
  2. voting me as a witness proxy - let @justyy represent you.

Thank you! Some of My Contributions: SteemYY.com - SteemIt Tutorials, Robots, Tools and APIs and VPS Search Tool

Sort:  

Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!

Reply !stop to disable the comment. Thanks!

hi @justyy, i tried to use https://steemyy.com/wallet/ feature to send steem to multiple account but it keep prompting me "[object Object]" in logs, how can i get it working ? tried sending 5 steem to 5 different accounts.

Have you entered the correct ACTIVE KEY?

yeah. to double confirm i went to test it again, checking all fields, i entered the correct active key. still get the same error code.

btw i m sending to bidbot, does it block bidbot accounts ?

could you press F12 in Chrome and send me a screenshot of the errors?

pm you on discord

Hi @justyy!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 6.885 which ranks you at #94 across all Steem accounts.
Your rank has dropped 5 places in the last three days (old rank 89).

In our last Algorithmic Curation Round, consisting of 243 contributions, your post is ranked at #123.

Evaluation of your UA score:
  • You've built up a nice network.
  • The readers appreciate your great work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.36
TRX 0.12
JST 0.039
BTC 69735.97
ETH 3533.64
USDT 1.00
SBD 4.72