home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.misc
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!udel!rochester!cornell!batcomputer!lynx.msc.cornell.edu!tamar.msc.cornell.edu!dchin
- From: dchin@tamar.msc.cornell.edu (David W. Chin)
- Subject: How to add a suffix to a bunch of files?
- Message-ID: <1992Sep3.213646.26527@msc.cornell.edu>
- Keywords: shell, script, files, names
- Sender: news@msc.cornell.edu
- Organization: Cornell-Materials-Science-Center
- Date: Thu, 3 Sep 1992 21:36:46 GMT
- Lines: 27
-
- I have occasion to add suffices on a whole bunch of files, like a .1 suffix on
- all files in cat1 (just an example). What's an elegant way to do it?
- The one I thought of was:
-
- #!/bin/sh
- cd cat1
- for X in `ls -1`
- do
- eval "mv $X $X.1"
- done
-
- Thanks a lot in advance. (I hope this is not in an FAQ somewhere -- seems like
- something which is commonly done.)
-
-
- David Chin Cornell University '92
-
- ________________________________________________________________________
- Internet: |
- dchin@helios.tn.cornell.edu |
- Bitnet: | Phone: (607) 257-6576
- iojj@crnlassp | Add: 401 Thurston Ave., Ithaca
- iojj@crnlvax5 | NY 14850-2431
- iojj@crnla | Shoe size: 8 1/2
- ________________________________|_______________________________________
-
-
-