parallel: '-quoting for rc-shell.

This commit is contained in:
Ole Tange 2015-05-25 22:07:37 +02:00
parent 1a6ddb891e
commit 2ca7b7f201
3 changed files with 42 additions and 1 deletions

View file

@ -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 "") {

View file

@ -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

View file

@ -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