#!/usr/bin/perl # perl script to copy the cgi scripts from cgi-bin on the local # machine for presentation by the web server... $cgi_dir = "/home/httpd/cgi-bin/rb_sccs"; opendir DIR, $cgi_dir; @files = readdir DIR; closedir DIR; foreach $file (@files) { next if $file =~ /^\.{1,2}$/; $local = "$file.txt"; $local =~ s/\.cgi/_cgi/g; $cmd = "cp $cgi_dir/$file $local"; print "cmd is: $cmd\n"; `$cmd`; $cmd = "cp $cgi_dir/$file $file"; `$cmd`; chmod 0666, $local; }