From 69201240dc57c34a1fab6360c35ca1f5202ac7f0 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Wed, 23 Feb 2011 16:22:08 +0100 Subject: [PATCH] parallel: manpage update for -l 0 -L 0 -n 0, and -N 0. --- src/parallel.pod | 50 ++++++++++++++++++++++---------- testsuite/tests-to-run/test53.sh | 6 ++++ testsuite/wanted-results/test53 | 6 ++++ 3 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/parallel.pod b/src/parallel.pod index 145887ab..dd139645 100644 --- a/src/parallel.pod +++ b/src/parallel.pod @@ -512,6 +512,9 @@ Use at most I nonblank input lines per command line. Trailing blanks cause an input line to be logically continued on the next input line. +B<-L 0> means read one line, but insert 0 arguments on the command +line. + Implies B<-X> unless B<-m> is set. @@ -524,6 +527,9 @@ is optional. If I is not specified, it defaults to one. The B<-l> option is deprecated since the POSIX standard specifies B<-L> instead. +B<-l 0> means read one line, but insert 0 arguments on the command +line. + Implies B<-X> unless B<-m> is set. @@ -621,6 +627,9 @@ I arguments will be used if the size (see the B<-s> option) is exceeded, unless the B<-x> option is given, in which case GNU B will exit. +B<-n 0> means read one argument, but insert 0 arguments on the command +line. + Implies B<-X> unless B<-m> is set. @@ -633,6 +642,9 @@ also makes replacement strings B<{1}> .. B<{>IB<}> that represents argument 1 .. I. If too few args the B<{>IB<}> will be empty. +B<-N 0> means read one argument, but insert 0 arguments on the command +line. + This will set the owner of the homedir to the user: B @@ -1147,7 +1159,7 @@ B To convert *.wav to *.mp3 using LAME running one process per CPU core run: -B +B =head1 EXAMPLE: Inserting multiple arguments @@ -1267,15 +1279,15 @@ B Recompress all .gz files in current directory using B running 1 job per CPU core in parallel: -B>B<{.}.bz2 && rm {}" ::: *.gz> +B>B<{.}.bz2 && rm {}" ::: *.gz> Convert all WAV files to MP3 using LAME: -B +B Put all converted in the same directory: -B +B =head1 EXAMPLE: Removing two file extensions when processing files and calling GNU Parallel from itself @@ -1458,8 +1470,8 @@ To include the local computer add the special sshlogin ':' to the list: : GNU B will try to determine the number of CPU cores on each -of the remote computers, so B<-j+0> will run one job per CPU core - -even if the remote computers do not have the same number of CPU cores. +of the remote computers, and run one job per CPU core - even if the +remote computers do not have the same number of CPU cores. If the number of CPU cores on the remote computers is not identified correctly the number of CPU cores can be added in front. Here the @@ -1542,7 +1554,7 @@ the special short hand I<-S ..> can be used: Convert *.mp3 to *.ogg running one process per CPU core on local computer and server2: - parallel --trc {.}.ogg -j+0 -S server2,: \ + parallel --trc {.}.ogg -S server2,: \ 'mpg321 -w - {} | oggenc -q0 - -o {.}.ogg' ::: *.mp3 =head1 EXAMPLE: Use multiple inputs in one command @@ -1589,6 +1601,14 @@ Note: The default for GNU B is to remove the spaces around the columns B +=head1 EXAMPLE: Run the same command 10 times + +If you want to run the same command with the same arguments 10 times +in parallel you can do: + +B + + =head1 EXAMPLE: Working as cat | sh. Resource inexpensive jobs and evaluation GNU B can work similar to B. @@ -1965,9 +1985,9 @@ variable $PARALLEL which takes precedence over the file If B<--profile> set, GNU B will read the profile from that file instead of ~/.parallel/config. -Example: Profile for running every command with B<-j+0> and B +Example: Profile for running every command with B<-j-1> and B - echo -j+0 nice > ~/.parallel/nice_profile + echo -j-1 nice > ~/.parallel/nice_profile parallel -J nice_profile bzip2 -9 ::: * Example: Profile for running a perl script before every command: @@ -2279,11 +2299,11 @@ using GNU B: B<1> ./ppss.sh standalone -d /path/to/files -c 'gzip ' -B<1> find /path/to/files -type f | parallel -j+0 gzip +B<1> find /path/to/files -type f | parallel gzip B<2> ./ppss.sh standalone -d /path/to/files -c 'cp "$ITEM" /destination/dir ' -B<2> find /path/to/files -type f | parallel -j+0 cp {} /destination/dir +B<2> find /path/to/files -type f | parallel cp {} /destination/dir B<3> ./ppss.sh standalone -f list-of-urls.txt -c 'wget -q ' @@ -2338,7 +2358,7 @@ B<2> ls myfiles*.ext | parallel sort {} ">{}.sort" B<3> pexec -f image.list -n auto -e B -u star.log -c -- \ 'fistar $B.fits -f 100 -F id,x,y,flux -o $B.star' -B<3> parallel -a image.list -j+0 \ +B<3> parallel -a image.list \ 'fistar {}.fits -f 100 -F id,x,y,flux -o {}.star' 2>star.log B<4> pexec -r *.png -e IMG -c -o - -- \ @@ -2459,11 +2479,11 @@ middleman(mdm) is also a tool for running jobs in parallel. Here are the shellscripts of http://mdm.berlios.de/usage.html ported to GNU B: -B>B< result> +B>B< result> -B +B -B +B =head2 DIFFERENCES BETWEEN xapply AND GNU Parallel diff --git a/testsuite/tests-to-run/test53.sh b/testsuite/tests-to-run/test53.sh index c8f0c889..e0992f47 100644 --- a/testsuite/tests-to-run/test53.sh +++ b/testsuite/tests-to-run/test53.sh @@ -5,3 +5,9 @@ seq 1 2 | parallel -n0 echo n0 seq 1 2 | parallel -L0 echo L0 seq 1 2 | parallel -l0 echo l0 seq 1 2 | parallel -N0 echo N0 + +echo '### Test replace {}' +seq 1 2 | parallel -N0 echo replace {} curlies + +echo '### Test arguments on commandline' +parallel -N0 echo args on cmdline ::: 1 2 diff --git a/testsuite/wanted-results/test53 b/testsuite/wanted-results/test53 index 87fdfe31..6ab97226 100644 --- a/testsuite/wanted-results/test53 +++ b/testsuite/wanted-results/test53 @@ -7,3 +7,9 @@ l0 l0 N0 N0 +### Test replace {} +replace curlies +replace curlies +### Test arguments on commandline +args on cmdline +args on cmdline