How to do mv *.xyz *.abc in shell script??
Keith Pyle
keith at sequoia.execu.com
Sat Sep 8 04:32:08 AEST 1990
OK, so it's not done with the shell, but the program mmv posted to
comp.sources.unix (Volume 21, Issue 87) does this and a good deal more.
With mmv, the method would be:
mmv '*.xyz' '=1.abc'
Here's a bit of the man page:
NAME
mmv - move/copy/append/link multiple files by wildcard pat-
terns
SYNOPSIS
mmv [-m|x|r|c|o|a|l|s] [-h] [-d|p] [-g|t] [-v|n] [from to]
DESCRIPTION
Mmv moves (or copies, appends, or links, as specified) each
source file matching a from pattern to the target name
specified by the to pattern. This multiple action is per-
formed safely, i.e. without any unexpected deletion of files
due to collisions of target names with existing filenames or
with other target names. Furthermore, before doing any-
thing, mmv attempts to detect any errors that would result
from the entire set of actions specified and gives the user
the choice of either proceeding by avoiding the offending
parts or aborting.
--
-----------------------------------------------------------------------------
Keith Pyle UUCP: ...!cs.utexas.edu!execu!keith
Execucom Systems Corp., Austin, Texas Internet: keith at execu.com
"It's 10 o'clock. Do you know where Disclaimer: What??
your child processes are?" You actually believed me?
-----------------------------------------------------------------------------
More information about the Comp.unix.shell
mailing list