Fixed bug: Error if command and input line are empty.

This commit is contained in:
Ole Tange 2007-09-11 08:00:26 +02:00
parent 92b673fe07
commit 1c9fcbdc37
6 changed files with 85 additions and 25 deletions

View file

@ -466,7 +466,10 @@ sub queue_job {
my $processes = shift; my $processes = shift;
my $command = shift; my $command = shift;
push @Global::command, $command; if($command =~ /\S/) {
# Only run commands - not empty lines
push @Global::command, $command;
}
if($Global::running_jobs <= $processes) { if($Global::running_jobs <= $processes) {
$Global::debug and print "queing $command\n"; $Global::debug and print "queing $command\n";
start_another_job(); start_another_job();

View file

@ -21,8 +21,8 @@ ls b
1-col.txt.diff 1-col.txt.diff
2-col.txt 2-col.txt
2-col.txt.diff 2-col.txt.diff
5 5 30 4 4 26
7 7 45 6 6 41
a a
b b
ls 1-col.txt.diff|wc;echo 1-col.txt.diff ls 1-col.txt.diff|wc;echo 1-col.txt.diff
@ -135,8 +135,8 @@ ls b|wc;echo b
1 more_than_5000-5998 1 more_than_5000-5998
1 more_than_5000-5999 1 more_than_5000-5999
1 more_than_5000-6000 1 more_than_5000-6000
5 b 4 b
7 a 6 a
1 1-col.txt 1 1-col.txt
1 1-col.txt.diff 1 1-col.txt.diff
1 2-col.txt 1 2-col.txt
@ -241,8 +241,8 @@ ls b|wc;echo b
1 more_than_5000-5998 1 more_than_5000-5998
1 more_than_5000-5999 1 more_than_5000-5999
1 more_than_5000-6000 1 more_than_5000-6000
5 b 4 b
7 a 6 a
1-col.txt.diff 1-col.txt.diff
1-col.txt.diff 1-col.txt.diff
2-col.txt 2-col.txt

View file

@ -1 +1,8 @@
There are 6246 dirs with 071eca55ffd15717546273235adeb775 -
There are 6246 dirs with 6246 files
Removing files
4e2ffc66811f839854f2f0071c1e0541 -
There are 6246 dirs with files
Removing dirs
14e628fb222c872cf383280269b2397f -
There are 1 dirs with files

View file

@ -7,19 +7,19 @@ cd tmp
find . -name '*.jpg' | parallel -j +0 convert -geometry 120 {} {}_thumb.jpg find . -name '*.jpg' | parallel -j +0 convert -geometry 120 {} {}_thumb.jpg
find . -name '*_thumb.jpg' | ren 's:/([^/]+)_thumb.jpg$:/thumb_$1:' find . -name '*_thumb.jpg' | ren 's:/([^/]+)_thumb.jpg$:/thumb_$1:'
ls | grep -v CVS | parallel ls | grep -v CVS | sort ls | parallel ls | sort
ls | grep -v CVS | parallel echo ls | grep -v CVS | sort ls | parallel echo ls | sort
ls | grep -v CVS | parallel -j 1 echo ls | grep -v CVS | sort ls | parallel -j 1 echo ls | sort
find -type f | grep -v CVS | parallel diff {} a/foo ">"{}.diff | grep -v CVS | sort find -type f | parallel diff {} a/foo ">"{}.diff | sort
ls | grep -v CVS | parallel -vg "ls {}|wc;echo {}" | grep -v CVS | sort ls | parallel -vg "ls {}|wc;echo {}" | sort
perl -e 'print map {"more_than_5000-$_\n" } (1..6000)' | parallel -j 100 touch | sort perl -e 'print map {"more_than_5000-$_\n" } (1..6000)' | parallel -j 100 touch | sort
perl -e 'print map {"more_than_5000-$_\n" } (1..5900)' | parallel -j 100 rm | sort perl -e 'print map {"more_than_5000-$_\n" } (1..5900)' | parallel -j 100 rm | sort
ls | grep -v CVS | parallel -j500 'sleep 1; ls {} | perl -ne "END{print $..\" {}\n\"}"' | grep -v CVS | sort ls | parallel -j500 'sleep 1; ls {} | perl -ne "END{print $..\" {}\n\"}"' | sort
ls | grep -v CVS | parallel -gj500 'sleep 1; ls {} | perl -ne "END{print $..\" {}\n\"}"' | grep -v CVS | sort ls | parallel -gj500 'sleep 1; ls {} | perl -ne "END{print $..\" {}\n\"}"' | sort
ls | grep -v CVS | parallel -g "perl -ne '/^\\S+\\s+\\S+$/ and print \$ARGV,\"\\n\"'" | grep -v CVS | sort ls | parallel -g "perl -ne '/^\\S+\\s+\\S+$/ and print \$ARGV,\"\\n\"'" | sort
ls | grep -v CVS | parallel -vg "perl -ne '/^\\S+\\s+\\S+$/ and print \$ARGV,\"\\n\"'" | grep -v CVS | sort ls | parallel -vg "perl -ne '/^\\S+\\s+\\S+$/ and print \$ARGV,\"\\n\"'" | sort
ls | grep -v CVS | parallel -qg perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' | grep -v CVS | sort ls | parallel -qg perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' | sort
ls | grep -v CVS | parallel -qvg perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' | grep -v CVS | sort ls | parallel -qvg perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' | sort
cd .. cd ..
rm -rf tmp rm -rf tmp

View file

@ -21,8 +21,8 @@ ls b
1-col.txt.diff 1-col.txt.diff
2-col.txt 2-col.txt
2-col.txt.diff 2-col.txt.diff
5 5 30 4 4 26
7 7 45 6 6 41
a a
b b
ls 1-col.txt.diff|wc;echo 1-col.txt.diff ls 1-col.txt.diff|wc;echo 1-col.txt.diff
@ -135,8 +135,8 @@ ls b|wc;echo b
1 more_than_5000-5998 1 more_than_5000-5998
1 more_than_5000-5999 1 more_than_5000-5999
1 more_than_5000-6000 1 more_than_5000-6000
5 b 4 b
7 a 6 a
1 1-col.txt 1 1-col.txt
1 1-col.txt.diff 1 1-col.txt.diff
1 2-col.txt 1 2-col.txt
@ -241,8 +241,8 @@ ls b|wc;echo b
1 more_than_5000-5998 1 more_than_5000-5998
1 more_than_5000-5999 1 more_than_5000-5999
1 more_than_5000-6000 1 more_than_5000-6000
5 b 4 b
7 a 6 a
1-col.txt.diff 1-col.txt.diff
1-col.txt.diff 1-col.txt.diff
2-col.txt 2-col.txt

View file

@ -48,3 +48,53 @@ b 6
b 7 b 7
b 8 b 8
b 9 b 9
a 1
a 10
a 11
a 12
a 13
a 14
a 15
a 16
a 17
a 18
a 19
a 2
a 20
a 21
a 22
a 23
a 24
a 25
a 3
a 4
a 5
a 6
a 7
a 8
a 9
b 1
b 10
b 11
b 12
b 13
b 14
b 15
b 16
b 17
b 18
b 19
b 2
b 20
b 21
b 22
b 23
b 24
b 25
b 3
b 4
b 5
b 6
b 7
b 8
b 9