#!/bin/perl
# my_recipe.pl
# Auguest 19, 1997
# Version 1.0
#
# This program looks through the directory for all files labeled with
# recipe-* and changes the ownership of them to jerparks and changes
# the permissions to read only by the outside.
#

$files = "recipe-";
$dir_file = "my_recipe";

system "ls -alg $files* > $dir_file";
$| = 1;

open(IN,"$dir_file") || warn "Can't open $dir_file for read: $!\n\n";
chop(@f=<IN>);
close IN;

foreach $L (@f)
{
  @g = split(' ',$L);
  if ($g[2]!~/jerparks/)
  {
	system "cp $g[8] $g[8].BAK";
	system "chmod 644 $g[8].BAK";
	system "rm -f $g[8]";
	system "mv $g[8].BAK $g[8]";
  }
}

system "rm $dir_file";

exit;




