Files
bare-operating-system/packages/bare-os-coreutils/man/pages/xargs.json
T
2026-04-03 17:56:46 -04:00

41 lines
1.2 KiB
JSON

{
"name": "xargs",
"section": 1,
"title": "construct argument lists and invoke utility",
"synopsis": [
"xargs [-0] [-n maxargs] [--] [utility [argument ...]]"
],
"description": "Reads stdin, splits into words (or null-terminated records with -0), and invokes the utility via ctx.runBinCommand in batches. Enforces fixed limits on stdin size, token count, arguments per run, and total invocations.",
"options": [
{
"flag": "-0, --null",
"meaning": "Input items are separated by null bytes instead of whitespace"
},
{
"flag": "-n maxargs, --max-args maxargs",
"meaning": "Use at most maxargs arguments from stdin per utility invocation (capped at 128)"
}
],
"keywords": [
"xargs",
"arguments",
"bare-os",
"coreutils"
],
"bareOsNotes": "No host fork; subset of POSIX/GNU xargs. See src/xargs.js for numeric limits.",
"examples": [
{
"caption": "pass lines as arguments",
"code": "printf 'a\\nb\\n' | xargs echo"
},
{
"caption": "one argument per run",
"code": "printf 'a\\nb\\n' | xargs -n1 echo"
},
{
"caption": "workaround for complex scripts",
"code": "# for f in *.txt; do grep -l foo $f; done"
}
]
}