Hacker News new | ask | show | jobs
by em500 1037 days ago
Except Perl isn't always present by default either (e.g. in Arch Linux or FreeBSD).
2 comments

There are also many Linux distributions that do not install by default all the POSIX utilities, but only the minimal set that is needed to bootstrap the system.

On all such systems, it is very easy for the user to install any missing POSIX utility, but it is also easy to install any non-POSIX GNU utility.

So not even xargs is certain to exist by default on all systems.

Moreover, POSIX xargs is restricted to execute sequentially all processes.

Any use of xargs for parallel execution is non-POSIX, so in that case there is no reason to not use "parallel" instead.

    parallel --embed > parallel.sh
 
Then store that in your source repo and use it wherever shells are used!
On Debian 11.7:

   $ parallel --embed > parallel.sh
   Unknown option: embed
[edit] Ran it in Ubuntu 22.04, it does output a bash script ... which still depends on Perl.
isn't perl always installed?
It is not, at least on FreeBSD and NetBSD.
Would this taint the other code in your repo with the GPL? I'd guess it would depend on how it is distributed.
If you're running on your private build infra, it's fine. If you're pushing that repo to somewhere public, it's now GPL.
To install parallel, first run parallel --embed?