I'm working with a machine that has a problem with the ownership of symlinks. I need to search the entire directory tree for symlinks. Then, if they are owned by a specific user, change the user and group. Then I want to echo the full path to the symlink changed. This machine is using Perl 4, so I don't think modules are an option. I'd appreciate any help/suggestions.
chomp (@files = `ls -R /`); #Is there a better way to
#find all symlinks on system?
foreach $x (@files) {
if (-l $x && -o $x) { #How do I test for ownership
chown (1234, 35, $x); #of a specific user?
print "Changed $x\n"; #How do I print the full path?
}
}