how to do getpwnam/getpwuid etc in tcl

て烟熏妆下的殇ゞ 提交于 2019-12-24 07:03:11

问题


does tcl have a standard way of doing NSS lookups (getpwnam, setpwent,...)


回答1:


Tcl doesn't expose those as APIs (it doesn't really use them internally either) but the TclX extension package does support exactly what you want I believe. For example:

package require TclX

set uid [id convert user $tcl_platform(user)]
puts "Your userid is $uid and you are a member of these groups: [id groups]"

If you're using ActiveTcl, you've definitely got the TclX package available (either already installed or available from the teapot repository).



来源:https://stackoverflow.com/questions/3791203/how-to-do-getpwnam-getpwuid-etc-in-tcl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!