That's not short. This is short: :-)
#!/usr/bin/perl
@n=('pwu','grg');sub n{local($n)=eval"get$n[$_[1]]id(\$_[0])";$n&&"($n)";}sub nm
{$a-$b;}@gr=split(' ',$();$g=shift(@gr);$\="\n";print"uid=$<",&n($<)," gid=",$g,
&n($(,1),(" euid=$>".&n($>))x($<!=$>),(" egid=".$)+0 .&n($),1))x($(!=$)),
(" groups=".join(',',sort nm grep(($_.=&n($_,1))||1,@gr)))x($#gr>=0);
Though I'll admit readability suffers slightly...
Larry
|