parallel: cygwin support for --load.

This commit is contained in:
Ole Tange 2015-03-26 00:09:32 +01:00
parent 57c8ca0823
commit af9dd80129
3 changed files with 17 additions and 1 deletions

View file

@ -219,6 +219,8 @@ Haiku of the month:
New in this release: New in this release:
* GNU Parallel now has a DOI: https://dx.doi.org/10.5281/zenodo.16303
* GNU Parallel was cited in: Bayesian inference of protein structure from chemical shift data https://peerj.com/articles/861/ * GNU Parallel was cited in: Bayesian inference of protein structure from chemical shift data https://peerj.com/articles/861/
* <<afventer opdatering>> CIDER: a pipeline for detecting waves of coordinated transcriptional regulation in gene expression time-course data http://biorxiv.org/content/biorxiv/early/2015/03/17/012518.full.pdf * <<afventer opdatering>> CIDER: a pipeline for detecting waves of coordinated transcriptional regulation in gene expression time-course data http://biorxiv.org/content/biorxiv/early/2015/03/17/012518.full.pdf

View file

@ -4081,6 +4081,9 @@ sub loadavg_too_high {
# aix => "ps -ae -o state,command" # state wrong # aix => "ps -ae -o state,command" # state wrong
# bsd => "ps ax -o state,command" # bsd => "ps ax -o state,command"
# sysv => "ps -ef -o s -o comm" # sysv => "ps -ef -o s -o comm"
# cygwin => perl -ne 'close STDERR; /Name/ and print"\n"; \
# /(Name|Pid|Ppid|State):\s+(\S+)/ and print "$2\t";' /proc/*/status |
# awk '{print $2,$1}'
# dec_osf => bsd # dec_osf => bsd
# dragonfly => bsd # dragonfly => bsd
# freebsd => bsd # freebsd => bsd
@ -4101,10 +4104,13 @@ sub loadavg_too_high {
$sysv2="ps -ef -o state -o comm"; $sysv2="ps -ef -o state -o comm";
$bsd="ps ax -o state,command"; $bsd="ps ax -o state,command";
$psel="ps -el|awk '{ print \$2,\$14,\$15 }'"; $psel="ps -el|awk '{ print \$2,\$14,\$15 }'";
$cygwin=q{ perl -ne 'close STDERR; /Name/ and print"\n";
/(Name|Pid|Ppid|State):\s+(\S+)/ and print "$2\t";' /proc/*/status |
awk '{print $2,$1}' };
$dummy="echo S COMMAND;echo R dummy"; $dummy="echo S COMMAND;echo R dummy";
%ps=( %ps=(
'aix' => "uptime", 'aix' => "uptime",
'cygwin' => $sysv, 'cygwin' => $cygwin,
'darwin' => $bsd, 'darwin' => $bsd,
'dec_osf' => $sysv2, 'dec_osf' => $sysv2,
'dragonfly' => $bsd, 'dragonfly' => $bsd,

View file

@ -4090,6 +4090,14 @@ completely for certain jobs (and may even be considered less readable):
map -p 4 'echo -n % 2>&1 | sed -e "s/^/$$:/"' 1 2 3 | sort | cut -f2- -d: map -p 4 'echo -n % 2>&1 | sed -e "s/^/$$:/"' 1 2 3 | sort | cut -f2- -d:
B<map>s replacement strings (% %D %B %E) can be simulated in GNU
B<parallel> by putting this in B<~/.parallel/config>:
--rpl '%'
--rpl '%D $_=::shell_quote(::dirname($_));'
--rpl '%B s:.*/::;s:\.[^/.]+$::;'
--rpl '%E s:.*\.::'
B<map> cannot handle bundled options: B<map -vp 0 echo this fails> B<map> cannot handle bundled options: B<map -vp 0 echo this fails>
B<map> does not have an argument separator on the command line, but B<map> does not have an argument separator on the command line, but