#!/usr/local/bin/perl # Copyright (C) 1998 Andrew Loree # $Id: chext.pl,v 1.1.1.1 2003/10/05 21:51:29 andy Exp $ ############################################################################ # # chext - Change file extenstions to 'ext', appending them to the end of the # file. Optionally, all other extension can be dropped. Type # 'chext' at the shell prompt for specific usage # ############################################################################ $version = "1.0"; if ($#ARGV < 1){ # Check arguments print <; if ($answer !~ /^y/i){ next; # Next file } } if (rename($old_filename, $new_filename) == 0){ print "Unable to rename $old_filename to $new_filename\n"; } } else{ print "Invalid filename: $old_filename\n"; } }