diff -uNr parallel/src/parallel parallel.mod/src/parallel --- parallel/src/parallel 2023-09-28 21:55:48.803300511 +0800 +++ parallel.mod/src/parallel 2023-09-28 21:58:17.203300520 +0800 @@ -2241,7 +2241,7 @@ ## Shell # $Global::shell = $ENV{'PARALLEL_SHELL'} || parent_shell($$) - || $ENV{'SHELL'} || "/bin/sh"; + || $ENV{'SHELL'} || "@TERMUX_PREFIX@/bin/sh"; if(not -x $Global::shell and not which($Global::shell)) { ::error("Shell '$Global::shell' not found."); wait_and_exit(255); @@ -2917,14 +2917,14 @@ $Global::trim = 'n'; $Global::max_jobs_running = 0; $Global::job_already_run = ''; - $ENV{'TMPDIR'} ||= "/tmp"; - $ENV{'PARALLEL_REMOTE_TMPDIR'} ||= "/tmp"; + $ENV{'TMPDIR'} ||= "@TERMUX_PREFIX@/tmp"; + $ENV{'PARALLEL_REMOTE_TMPDIR'} ||= "@TERMUX_PREFIX@/tmp"; # bug #55398: set $OLDPWD when using --wd $ENV{'OLDPWD'} = $ENV{'PWD'}; if(not $ENV{HOME}) { # $ENV{HOME} is sometimes not set if called from PHP - ::warning("\$HOME not set. Using /tmp."); - $ENV{HOME} = "/tmp"; + ::warning("\$HOME not set. Using @TERMUX_PREFIX@/tmp."); + $ENV{HOME} = "@TERMUX_PREFIX@/tmp"; } # no warnings to allow for undefined $XDG_* no warnings 'uninitialized'; @@ -4972,7 +4972,7 @@ unlink $stderrname; my $pid = ::open3($stdin_fh,$stdout_fh,$stderr_fh, - $0,qw(--plain --shell /bin/sh --will-cite), @args); + $0,qw(--plain --shell @TERMUX_PREFIX@/bin/sh --will-cite), @args); if(my $writerpid = fork()) { close $stdin_fh; @stdout = <$stdout_fh>; @@ -8632,7 +8632,9 @@ # 'threads' => #threads # 'active' => #taskset_threads } # Use GNU/Linux - return sct_gnu_linux($_[0]); + #return sct_gnu_linux($_[0]); + # Use Hurd which uses nproc + return sct_hurd($_[0]); } sub sct_freebsd($) {