Using modules with csh shell. csh not my choice, cannot change that.
I want to keep the $jobRunName as exactly that in the alias, so in the shell that can be a shell env var to use there.
set-alias seems to want to change $ into !!, I have not found anything about that anywhere in the googlez.
In the modulefile loaded:
set queueNameBatch "testQueue"
set jobRunName "\$jobRunName"
set jobQcmd "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
I had previously tried {} instead of "" around he alias string but that just gave me
set-alias qt {$jobQcmd $queueNameBatch }
which qt
qt: aliased to !!:jobQcmd !!:queueNameBatch
So the doublequotes seem better here
Any idea how to fix this so !!: goes back to the intended $ sign?
Using modules with csh shell. csh not my choice, cannot change that.
I want to keep the $jobRunName as exactly that in the alias, so in the shell that can be a shell env var to use there.
set-alias seems to want to change $ into !!, I have not found anything about that anywhere in the googlez.
In the modulefile loaded:
set queueNameBatch "testQueue"
set jobRunName "\$jobRunName"
set jobQcmd "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
I had previously tried {} instead of "" around he alias string but that just gave me
set-alias qt {$jobQcmd $queueNameBatch }
which qt
qt: aliased to !!:jobQcmd !!:queueNameBatch
So the doublequotes seem better here
Any idea how to fix this so !!: goes back to the intended $ sign?
Share Improve this question asked Feb 2 at 23:06 billtbillt 1011 silver badge1 Answer
Reset to default 0Modules change variable reference for csh shell. Using puts
modulefile command will help to get the exact expected alias code
set qt_alias {sbatch -o ./logs/srun.%j.log -e ./logs/srun.%j.err -J $jobRunName -p testQueue}
if {[module-info shelltype csh] && [module-info mode load]} {
puts stdout "alias qt \"$qt_alias\";"
} else {
set-alias qt $qt_alias
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745254146a4618854.html
评论列表(0条)