Bug #5131

[Crunch] run-command passes escape backslashes through

Added by Brett Smith over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Brett Smith
Category:
Crunch
Target version:
Start date:
02/03/2015
Due date:
% Done:

100%

Estimated time:
(Total: 0.50 h)
Story points:
0.5

Description

run-command lets you prefix characters with a backslash to prevent it from interpreting them. However, when you do this, it leaves the backslash in the original string. This can leave you in situations where there's no way to write a command that works as intended. For example, here's a user's command parameter:

["bash", "-c", "(vcf-merge \\$(ls -1 *.vcf.gz | perl -pe 's/\\n/ /g') > merge.vcf)"]

If you remove the backslashes before the $, run-command tries to interpret the subcommand. With the backslashes in, however, they get passed to bash, so bash dies with a syntax error.

run-command should "consume" escape backslashes.


Subtasks

Task #5132: Review 5131-run-command-consume-backslashes-wipResolvedPeter Amstutz

Associated revisions

Revision 906aa5e3
Added by Brett Smith over 5 years ago

Merge branch '5131-run-command-consume-backslashes-wip'

Closes #5131, #5132.

Revision cad21664 (diff)
Added by Brett Smith over 5 years ago

5131: Document run-command's escape sequences.

Refs #5131.

History

#1 Updated by Brett Smith over 5 years ago

  • Description updated (diff)

#2 Updated by Brett Smith over 5 years ago

  • Status changed from New to In Progress
  • Assigned To set to Brett Smith

#3 Updated by Brett Smith over 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:906aa5e3427c1e89e5f426191e33af4b1c27fc7e.

Also available in: Atom PDF