Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.shell Subject: Re: How to do mv *.xyz *.abc in shell script?? Message-ID: <105938@convex.convex.com> Date: 7 Sep 90 16:33:28 GMT References: <5569@minyos.xx.rmit.oz> <1990Sep7.130010.28853@cs.utk.edu> Sender: news@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 22 I still like this one (from the FAQ): #!/usr/bin/perl # # rename script examples from lwall: # rename 's/\.orig$//' *.orig # rename 'y/A-Z/a-z/ unless /^Make/' * # rename '$_ .= ".bad"' *.f # rename 'print "$_: "; s/foo/bar/ if =~ /^y/i' * $op = shift; for (@ARGV) { $was = $_; eval $op; die $@ if $@; (rename($was,$_) || warn "$0: can't rename $was to $_: $!\n") if $was ne $_; } -- "UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." [Doug Gwyn]