in LAMMPS, I have simulated and generated dump files, whose full path is held inside in string type variable. I want to pass that comment directly to poweshell. Suppose, I have
variable dump_name string "C:/path/to/test_dump_000.cfg"
variable program_name string "D:/way/for/program.exe"
While in powershell, I need to manually enter
& "C:/path/to/test_dump_000.cfg" "D:/way/for/program.exe"
to avoid doing that manually, I written on my lammps input file
variable shellcom string '& "${dump_name}" "${program_name}"'
shell shellcom
The problem is, the command sent to powershell is not
& "C:/path/to/test_dump_000.cfg" "D:/way/for/program.exe"
but rather
& ${dump_name} ${program_name}
LAMMPS is obstinately refusing to evaluate if I encase ${…} with single or double quotes. I have used ‘’ instead of ’ or “” instead of " to have literal " or ’ in my string, but both caused error. that is
variable shellcom string '& ""${dump_name}"" ""${program_name}""'
shell shellcom
shows error , because it feeds into powershell
& ""C:/path/to/test_dump_000.cfg"" ""D:/way/for/program.exe""
and similarly
variable shellcom string "& ''${dump_name}'' ''${program_name}''"
shell shellcom
shows error , because it feeds into powershell
& ''C:/path/to/test_dump_000.cfg'' ''D:/way/for/program.exe''
I cannot concatenate & followed by space followed by a single ’ or “” (even if I enter as double ‘’ or “”) before dump_name variable to create any other variable, so, this way is also closed for me.
to worsen the matter, my LAMMPS GUI build (29apr2024 i think!) is not built with python, (I have installed from .exe file, and I cannot build a .exe) so I cannot invoke regex of python as well.
Now, what can I do?