Skip to content

mcrun arguments needs extra escaping of semicolons #1685

@tkittel

Description

@tkittel

As discussed with @willend, I just noticed the following a bit unfortunate issue, which I encountered while trying to put an NCrystal cfg-string with semicolons into a string parameter of mcrun:

$> mcrun -c NCrystal_example.instr sample_cfg='Al_sg225.ncmat;density=10x' 

It actually results in sample_cfg="Al_sg225.ncmat" and not the expected sample_cfg="Al_sg225.ncmat;density=10x".

It works with a backslash in front of the semicolon:

$> mcrun -c NCrystal_example.instr sample_cfg='Al_sg225.ncmat\;density=10x' 

This was noticed in the context of a jupyter notebook, where I was trying to:

!mcrun sample_cfg={shlex.quote(mycfgstr)}

The initial theory from @willend is that this is related to moving the arguments through BASH (certainly sounds like something BASH would do!), and that we need to double-check arguments passed via mcgui as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions