Tcl 打印 cwd 并将其用作字符串
我正在 tcl 中为 VMD 制作一个小脚本:
mol load psf run_1/structure.psf xtc run_1/postDocking_wrapped.xtc
set final [atomselect top "not (water or ions or resid 1216)" frame last]
$final writepdb last_frame.pdb
puts "finished!"
quit
我希望我可以将我正在使用的文件夹作为字符串添加到 last_frame.pdb,
例如:last_frame_A1234.pdb 其中 A1234 是我当前的文件夹。 当我尝试时:
set path [file dirname [file normalize [info script] ] ]
它只返回一个“。”
我也尝试过:
set path [file [info script]]
但结果始终是“。”而不是 A1234F。
如果我输入:
set path [pwd]
它会给我完整路径(带有“/”)并且 writepdb 不接受特殊字符。
有什么办法可以只获取cwd吗?或者从 pwd 仅访问最后一个文件夹并将其用作字符串?
谢谢你!
I was making a small script in tcl for VMD:
mol load psf run_1/structure.psf xtc run_1/postDocking_wrapped.xtc
set final [atomselect top "not (water or ions or resid 1216)" frame last]
$final writepdb last_frame.pdb
puts "finished!"
quit
I wish i could add the folder I'm working in as a string to last_frame.pdb
like: last_frame_A1234.pdb where A1234 is my current folder.
When I try:
set path [file dirname [file normalize [info script] ] ]
it just returns a "."
I have also tried:
set path [file [info script]]
but the result is always the "." rather than A1234F.
If I put:
set path [pwd]
it would give me the full path (with the "/") and writepdb does not accept special characters.
Is there any way to just get the cwd? or from pwd access only to the last folder and use it as a string?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
设置路径[file tail [pwd]]
Try:
set path [file tail [pwd]]