Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mcrun arguments needs extra escaping of semicolons #1685

Open
tkittel opened this issue Sep 3, 2024 · 0 comments
Open

mcrun arguments needs extra escaping of semicolons #1685

tkittel opened this issue Sep 3, 2024 · 0 comments

Comments

@tkittel
Copy link
Contributor

tkittel commented Sep 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant