Bash – xargs “too long argument list”

bashxargs

I want to do something like this:

cat 5.txt | xargs -0 openssl prime

but xargs is saying that argument list is too long


Edit:

cat 3.txt | xargs -n 1 openssl prime | wc -l

works, thanks

Best Answer

You can try using xargs's -n:

Use at most max-args arguments per command line.

Also worth noting xargs can be made to

Print the command line on the standard error output before executing it.

with -t, which is rather useful for debuging.