in reply to Perl for Unix System Administration
I have my simple one myself you might want to consider. It's just another mass file operation type, similiar to the traverse file system stuff. But rather, mine's task is performing file permission changing (chmod), specifically, adding or repairing them to put 'w' bit for group. I'm not quite sure actually if this can be seen as sysadmin job. I usually run it for sharing purpose, for other users within the same group. However, the modes are customizable via command line options. Here it goes (I use -s for simpel CLO parsing).
Oh, a little note about this,#!/usr/bin/perl -ws use strict; use vars qw($f $d); use File::Find; my $start_dir = shift || '.'; my $dir_mode = $d ? oct($d) : 0775; my $file_mode = $f ? oct($f) : 0664; find \&wanted, $start_dir; sub wanted { my $mode = -d() ? $dir_mode : $file_mode; chmod $mode, $_ or die "Can't chmod $_: $!\n"; } __END__
Writing an Excel file. (example coming soon). Many times we are required to create reports in text format. That's easy with Perl, that's what the Reporting part of the name Perl came from.While it's a nice say, nevertheless, the name Perl was and is never meant as an acronym. The "Practical Extraction and Reporting Language" came later.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl for Unix System Administration
by szabgab (Priest) on Apr 10, 2007 at 16:40 UTC | |
by naikonta (Curate) on Apr 10, 2007 at 17:02 UTC |