79637155

Date: 2025-05-24 20:45:26
Score: 0.5
Natty:
Report link

It looks like I found something that works for csh host shell, using concat and separating quoted and curly-braced sections of my intended command string, no more !!: nonsense, no more somethign trying to resolve the $jobRunName variable at the wrong time, this actually gives me the expected $ in my alias:

set queueNameBatch "testQueue"
set jobQcmd         [ concat "sbatch -o ./logs/srun.%j.log -e ./logs/srun.%j.err " { -J \$jobRunName -p } ]
set-alias qt "$jobQcmd $queueNameBatch "
which qt
qt:      aliased to sbatch -o ./logs/srun.%j.log -e ./logs/srun.%j.err -J $jobRunName -p testQueue

This works regardless of if the shell already has a setenv jobRunName already done or not. The alias seems to work, and of course gives an undefined variable error if I have not done any setenv jobRunName before running the alias, which is expected.

If I do a setenv jobRunName before running this alias then it does work as expected. Doing setenv jobRunName now can happen AFTER loading this module as long as it happens BEFORE running the alias.

There is something else I'm trying to add about having some portions appended togethre to make a path as a shell variable as it is plus a tcl variable evaluated to its value, concat seems to add a space at the joint in the middle of the output for this path that breaks that, maybe a join for that portion but I haven't got something working all the way I want for that just yet. I will update if/when I get that satisactory too.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: billt