home *** CD-ROM | disk | FTP | other *** search
- char *gacScript[] = {
- "#!/usr/bin/perl\n",
- "'di';\n",
- "'ig00';\n",
- "#\n",
- "# $Header: rename,v 4.0 91/03/20 01:11:53 lwall Locked $\n",
- "#\n",
- "# $Log: rename,v $\n",
- "# Revision 4.0 91/03/20 01:11:53 lwall\n",
- "# 4.0 baseline.\n",
- "# \n",
- "# Revision 3.0.1.2 90/08/09 03:17:57 lwall\n",
- "# patch19: added man page for relink and rename\n",
- "# \n",
- "\n",
- "($op = shift) || die \"Usage: rename perlexpr [filenames]\\n\";\n",
- "if (!@ARGV) {\n",
- " @ARGV = <STDIN>;\n",
- " chop(@ARGV);\n",
- "}\n",
- "for (@ARGV) {\n",
- " $was = $_;\n",
- " eval $op;\n",
- " die $@ if $@;\n",
- " rename($was,$_) unless $was eq $_;\n",
- "}\n",
- "##############################################################################\n",
- "\n",
- " # These next few lines are legal in both Perl and nroff.\n",
- "\n",
- ".00; # finish .ig\n",
- " \n",
- "'di \\\" finish diversion--previous line must be blank\n",
- ".nr nl 0-1 \\\" fake up transition to first page again\n",
- ".nr %% 0 \\\" start at page 1\n",
- "';<<'.ex'; #__END__ ############# From here on it's a standard manual page ############\n",
- ".TH RENAME 1 \"July 30, 1990\"\n",
- ".AT 3\n",
- ".SH NAME\n",
- "rename \\- renames multiple files\n",
- ".SH SYNOPSIS\n",
- ".B rename perlexpr [files]\n",
- ".SH DESCRIPTION\n",
- ".I Rename\n",
- "renames the filenames supplied according to the rule specified as the\n",
- "first argument.\n",
- "The argument is a Perl expression which is expected to modify the $_\n",
- "string in Perl for at least some of the filenames specified.\n",
- "If a given filename is not modified by the expression, it will not be\n",
- "renamed.\n",
- "If no filenames are given on the command line, filenames will be read\n",
- "via standard input.\n",
- ".PP\n",
- "For example, to rename all files matching *.bak to strip the extension,\n",
- "you might say\n",
- ".nf\n",
- "\n",
- " rename 's/\\e.bak$//' *.bak\n",
- "\n",
- ".fi\n",
- "To translate uppercase names to lower, you'd use\n",
- ".nf\n",
- "\n",
- " rename 'y/A-Z/a-z/' *\n",
- "\n",
- ".fi\n",
- ".SH ENVIRONMENT\n",
- "No environment variables are used.\n",
- ".SH FILES\n",
- ".SH AUTHOR\n",
- "Larry Wall\n",
- ".SH \"SEE ALSO\"\n",
- "mv(1)\n",
- ".br\n",
- "perl(1)\n",
- ".SH DIAGNOSTICS\n",
- "If you give an invalid Perl expression you'll get a syntax error.\n",
- ".SH BUGS\n",
- ".I Rename\n",
- "does not check for the existence of target filenames, so use with care.\n",
- ".ex\n",
- "\n",
- NULL
- };