substitution conflicts between perframe subcommands and runscript arguments

Hey there So I'm invoking some rendering jobs like this: `cx --script "./a.cxc 2 3"` Inside a.cxc there's something like: ``` perframe "coordset #1 $1" frames 24 format %03d range $1,$2,1 showCommands true ``` Now the problem is that the script arguments in the script are all being replaced So $1 in the perframe subcommand becomes "2" just like in the range option I couldn't find documentation on a built-in escape mechanism yet I tried "\$1" and "$$1" w/o success tho Alternatives that I see are generating a list of script files that don't rely on substitution and have hard-coded frame offsets or ig I could also explore python scripting Wanted to ask if there's a way to do it with escaping tho Thanks!

Hi, I'm not aware of any escape mechanism that with prevent the conflict between perframe's $N substitution and the similar --script substitution. However you can use a trick to preserve the "$1" for the perframe command to see. Change your perframe command to: perframe "coordset #1 $1" frames 24 format %03d range $2,$3,1 showCommands true (i.e. the 'range' args are $2,$3 instead of $1,$2) and change your script invocation to: cx --script './a.cxc $1 2 3' So that the $1 inside the script remains $1 for the perframe command to see. Note the single quotes around the --script argument to prevent the shell from changing the $1. --Eric Eric Pettersen UCSF Computer Graphics Lab
On Jun 24, 2025, at 3:22 PM, d--- via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hey there
So I'm invoking some rendering jobs like this: `cx --script "./a.cxc 2 3"`
Inside a.cxc there's something like:
``` perframe "coordset #1 $1" frames 24 format %03d range $1,$2,1 showCommands true ```
Now the problem is that the script arguments in the script are all being replaced
So $1 in the perframe subcommand becomes "2" just like in the range option
I couldn't find documentation on a built-in escape mechanism yet
I tried "\$1" and "$$1" w/o success tho
Alternatives that I see are generating a list of script files that don't rely on substitution and have hard-coded frame offsets or ig I could also explore python scripting
Wanted to ask if there's a way to do it with escaping tho
Thanks! _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
participants (3)
-
d@wolf.gdn
-
david wolf
-
Eric Pettersen