Skip to content

xargs: refresh page#21353

Open
Managor wants to merge 7 commits intomainfrom
xargs
Open

xargs: refresh page#21353
Managor wants to merge 7 commits intomainfrom
xargs

Conversation

@Managor
Copy link
Member

@Managor Managor commented Mar 3, 2026

Some inspiration from distrotube https://www.youtube.com/watch?v=tUkQcvytVtw

@github-actions github-actions bot added page edit Changes to an existing page(s). review needed Prioritized PRs marked for reviews from maintainers. labels Mar 3, 2026
- Print the piped data:

- Run multiple chained commands on the input data:
`{{arguments_source}} | xargs`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the use of this example? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To display what data xargs is receiving. It's also the simplest form of the command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it is technically the simplest, but it also does nothing. I mean, if you don't pipe to xargs, you'd get exactly the same output in the stdout, no? Or am I missing something?

Copy link
Member Author

@Managor Managor Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly the same. All data is concatenated, separated by spaces even if the original data contains newlines

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still seems like something that other commands (e.g. sed, tr) would be more appropriate for than xargs IMHO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted the description a bit so that it can be considered as a dry-run.


- Define maximum amount of parallel processes (default is 1). If the number is 0, xargs will run as many processes as possible at a time:

`{{arguments_source}} | xargs {{[-P|--max-procs]}} {{number}} {{command}}`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh hey, good question here: does --max-procs even do anything if --max-args isn't set?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't focus on the "maximum" aspect here. By default xargs only spawns one process, and this bumps that number up, so the original description seems clearer. I agree with your choice of using parenthesis for the default, though. So: "Parallel runs of up to max-procs processes at a time (default is 1)."

As for --max-args, it seems like we might want to add {{[-n|--max-args]}} 1 here, yeah. But I'm not a xargs expert, so maybe others can help clarify if that makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. I only assumed so since you've been prevalent in the history of this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

page edit Changes to an existing page(s). review needed Prioritized PRs marked for reviews from maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants