Here's a small utility for you:
 
USING: io.launcher io.encodings.utf8 sequences sets documents.private ;
: user-groups ( -- seq/f )
    "whoami /groups" utf8 [ contents ] with-process-reader split-lines
    dup [ members "= " = ] find
    [
        [ 1 + tail ] dip
        [ CHAR: space = ] find drop
        [ harvest ] dip
        [ head [ CHAR: space = ] trim ] curry map
    ] [ 2drop f ] if* ;
 

Usage:
 
"Administrators" user-groups in?
-> `t`
 
---=====---
Александр
 
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to