diff --git a/src/parallel b/src/parallel index 0ea8ac0e..87a70293 100755 --- a/src/parallel +++ b/src/parallel @@ -1660,7 +1660,7 @@ sub shell_quote_scalar { if(defined $a) { if(($a =~ s/'/''/g) + - ($a =~ s/[\n\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\^\*\<\=\>\~\|\; \"\!\$\&\202-\377]/'$&'/go)) { + ($a =~ s/[\n\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\^\*\<\=\>\~\|\; \"\!\$\&\202-\377]+/'$&'/go)) { # A string was replaced # No need to test for "" or \0 } elsif($a eq "") { diff --git a/testsuite/tests-to-run/parallel-local-0.3s.sh b/testsuite/tests-to-run/parallel-local-0.3s.sh index d9944ca0..2d4e86ec 100644 --- a/testsuite/tests-to-run/parallel-local-0.3s.sh +++ b/testsuite/tests-to-run/parallel-local-0.3s.sh @@ -158,6 +158,19 @@ echo '### bug #44995: parallel echo {#} ::: 1 2 ::: 1 2' parallel -k echo {#} ::: 1 2 ::: 1 2 +echo '**' + +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=bash parallel -0 echo +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=fish parallel -0 echo +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=ash parallel -0 echo +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=dash parallel -0 echo +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=sh parallel -0 echo +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=rc parallel -0 echo +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=csh parallel -0 echo +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=tcsh parallel -0 echo + +echo '**' + EOF echo '### 1 .par file from --files expected' find /tmp{/*,}/*.{par,tms,tmx} 2>/dev/null -mmin -10 | wc -l diff --git a/testsuite/wanted-results/parallel-local-0.3s b/testsuite/wanted-results/parallel-local-0.3s index 44f0d0a2..3fc57f45 100644 --- a/testsuite/wanted-results/parallel-local-0.3s +++ b/testsuite/wanted-results/parallel-local-0.3s @@ -332,5 +332,33 @@ parallel -k echo {#} ::: 1 2 ::: 1 2 2 3 4 +echo '**' +** +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=bash parallel -0 echo +"#&/ +()*=?' +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=fish parallel -0 echo +"#&/ +()*=?' +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=ash parallel -0 echo +"#&/ +()*=?' +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=dash parallel -0 echo +"#&/ +()*=?' +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=sh parallel -0 echo +"#&/ +()*=?' +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=rc parallel -0 echo +"#&/ +()*=?' +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=csh parallel -0 echo +"#&/ +()*=?' +printf '"#&/\n()*=?'"'" | PARALLEL_SHELL=tcsh parallel -0 echo +"#&/ +()*=?' +echo '**' +** ### 1 .par file from --files expected 1