mhearse has asked for the wisdom of the Perl Monks concerning the following question:
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? } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: admin script help
by ehdonhon (Curate) on Sep 30, 2003 at 06:17 UTC | |
Re: admin script help
by Abigail-II (Bishop) on Sep 30, 2003 at 07:34 UTC | |
Re: admin script help
by Juerd (Abbot) on Sep 30, 2003 at 07:00 UTC | |
Re: admin script help
by aquarium (Curate) on Sep 30, 2003 at 12:54 UTC |
Back to
Seekers of Perl Wisdom