This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix untimely destruction introduced by lvalue ops [RT#67838] by returning a TEMP...
[perl5.git] / t / op / groups.t
index c1cc889..ed549a0 100644 (file)
@@ -196,13 +196,14 @@ sub _system_groups {
     # prefer 'id' over 'groups' (is this ever wrong anywhere?)
     # and 'id -a' over 'id -Gn' (the former is good about spaces in group names)
 
-    $cmd = 'id -a 2>/dev/null';
+    $cmd = 'id -a 2>/dev/null || id 2>/dev/null';
     $str = `$cmd`;
     if ( $str && $str =~ /groups=/ ) {
         # $str is of the form:
         # uid=39957(gsar) gid=22(users) groups=33536,39181,22(users),0(root),1067(dev)
         # FreeBSD since 6.2 has a fake id -a:
         # uid=1001(tobez) gid=20(staff) groups=20(staff), 0(wheel), 68(dialer)
+        # On AIX it's id
         #
         # Linux may also have a context= field