如何在 tcl 中执行 getpwnam/getpwuid 等 [英] how to do getpwnam/getpwuid etc in tcl

查看:17
本文介绍了如何在 tcl 中执行 getpwnam/getpwuid 等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tcl 是否有进行 NSS 查找的标准方法(getpwnam、setpwent...)

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

推荐答案

Tcl 不会将它们作为 API 公开(它也没有真正在内部使用它们)但是 TclX 扩展包确实支持完全正确你想要什么 我相信.例如:

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]"

如果您使用的是 ActiveTcl,那么您肯定有可用的 TclX 包(已经安装或从茶壶存储库中可用).

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

这篇关于如何在 tcl 中执行 getpwnam/getpwuid 等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆