home *** CD-ROM | disk | FTP | other *** search
- #!/usr/local/bin/perl
-
- unshift(@ARGV, '-') if $#ARGV < $[;
- while ($ARGV = shift) {
- &soelim($ARGV);
- }
-
- sub soelim {
- local($file) = @_;
- local($_);
- local(*FILE);
-
- $file =~ s/^(.+)\.Z$/zcat $1.Z |/;
- if (!open (FILE, $file)) {
- if ($! =~ /no such file/i) {
- $file .= '.Z';
- if (-e $file) {
- &soelim($file);
- return;
- }
- }
- die "$0: can't open $file: $!\n";
- }
- while (<FILE>) {
- &soelim($1), next if /^\.so\s+(\S+)/;
- print;
- }
- }
-