mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 23:47:53 +00:00
Fixes: bug #34240: --pipe does not respect -r
This commit is contained in:
parent
b53dda2525
commit
795c0fa3bd
|
@ -242,7 +242,7 @@ parallel convert -resize {3} -quality {2} {1} {1.}_{3}_q{2}.jpg :::: - ::: 25 50
|
||||||
# Thank you for watching
|
# Thank you for watching
|
||||||
#
|
#
|
||||||
# If you like GNU Parallel:
|
# If you like GNU Parallel:
|
||||||
# * Post this video on forums/blogs/Google+/Twitter/Facebook/Linkedin
|
# * Post this video on forums/blogs/Identi.ca/Google+/Twitter/Facebook/Linkedin
|
||||||
# * Join the mailing list http://lists.gnu.org/mailman/listinfo/parallel
|
# * Join the mailing list http://lists.gnu.org/mailman/listinfo/parallel
|
||||||
# * Request or write a review for your favourite blog or magazine
|
# * Request or write a review for your favourite blog or magazine
|
||||||
# * Request or build a package for your favourite distribution
|
# * Request or build a package for your favourite distribution
|
||||||
|
|
|
@ -90,7 +90,7 @@ https://build.opensuse.org/package/show?package=parallel&project=home%3Atange
|
||||||
|
|
||||||
YYYYMMDD=`yyyymmdd`
|
YYYYMMDD=`yyyymmdd`
|
||||||
pushd /tmp
|
pushd /tmp
|
||||||
rm parallel-$YYYYMMDD.tar.bz2
|
rm -rf parallel-${YYYYMMDD}*
|
||||||
wget http://ftp.gnu.org/gnu/parallel/parallel-$YYYYMMDD.tar.bz2
|
wget http://ftp.gnu.org/gnu/parallel/parallel-$YYYYMMDD.tar.bz2
|
||||||
#wget http://alpha.gnu.org/gnu/parallel/parallel-$YYYYMMDD.tar.bz2
|
#wget http://alpha.gnu.org/gnu/parallel/parallel-$YYYYMMDD.tar.bz2
|
||||||
tar xjvf parallel-$YYYYMMDD.tar.bz2
|
tar xjvf parallel-$YYYYMMDD.tar.bz2
|
||||||
|
|
|
@ -186,6 +186,13 @@ sub spreadstdin {
|
||||||
while(read(STDIN,substr($buf,length $buf,0),$::opt_blocksize)) {
|
while(read(STDIN,substr($buf,length $buf,0),$::opt_blocksize)) {
|
||||||
# substr above = append to $buf
|
# substr above = append to $buf
|
||||||
reap_if_needed(); # Re-enable reaping after read() (Bug#33352)
|
reap_if_needed(); # Re-enable reaping after read() (Bug#33352)
|
||||||
|
if($::opt_r) {
|
||||||
|
# Remove empty lines
|
||||||
|
$buf=~s/^\s*\n//gm;
|
||||||
|
if(length $buf == 0) {
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
}
|
||||||
if($::opt_regexp) {
|
if($::opt_regexp) {
|
||||||
if($Global::max_number_of_args) {
|
if($Global::max_number_of_args) {
|
||||||
# -N => (start..*?end){n}
|
# -N => (start..*?end){n}
|
||||||
|
|
|
@ -24,4 +24,8 @@ parallel -j1 -kX echo {}-{.} ::: a ::: b
|
||||||
parallel -j2 -kX echo {}-{.} ::: a b ::: c d
|
parallel -j2 -kX echo {}-{.} ::: a b ::: c d
|
||||||
parallel -j2 -kX echo {}-{.} ::: a b c ::: d e f
|
parallel -j2 -kX echo {}-{.} ::: a b c ::: d e f
|
||||||
parallel -j0 -kX echo {}-{.} ::: a b c ::: d e f
|
parallel -j0 -kX echo {}-{.} ::: a b c ::: d e f
|
||||||
|
|
||||||
|
echo '### Test of -r with --pipe - the first should give an empty line. The second should not.'
|
||||||
|
echo | parallel -j2 -N1 --pipe cat | wc -l
|
||||||
|
echo | parallel -r -j2 -N1 --pipe cat | wc -l
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -41,3 +41,6 @@ b-b f-f
|
||||||
c-c d-d
|
c-c d-d
|
||||||
c-c e-e
|
c-c e-e
|
||||||
c-c f-f
|
c-c f-f
|
||||||
|
### Test of -r with --pipe - the first should give an empty line. The second should not.
|
||||||
|
1
|
||||||
|
0
|
||||||
|
|
Loading…
Reference in a new issue