Mumia W. wrote:
> On 12/20/2006 04:14 PM, Tom Smith wrote:
>> [...]
>> So is there a better way to do this, or perhaps a cleaner way?
> 
> use strict;
> use warnings;
> $_ = `id $ARGV[0]`;
> s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n";

print $1 if `groups $ARGV[0] 2>/dev/null` =~ /$ARGV[0]\s*:\s*(.+)/;



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to