in reply to 2048 character limit
You can open both files in Perl, which has no line length limits:
There are lots of ways to do this, many shortcuts. I showed this one because it's explicit about what it does. The use of lexical $in, $out as filehandles is relatively new, as is the three-argument open. For older perl, use globs like \*IN, \*OUT for filehandles, and concatenate the direction arrows '<', '>' with a space and the file path.{ my ( $in, $out ); open $in, '<', $filepath or die $!; open $out, '>', $newpath or die $!; while (<$in>) { # process $_ which is the current line $_ = quux($_); print $out; # assumes $_ has everything to print now } close $out or die $!; close $in; }
Update: After a lot of heat and little light, it seems that what you want is getgrent. If it fails, your /etc/group file is probably broken. See also 'perrldoc User::grent'.
After Compline,
Zaxo
|
|---|