home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.misc
- Path: sparky!uunet!murphy!jpradley!jpr
- From: jpr@jpradley.jpr.com (Jean-Pierre Radley)
- Subject: Re: How to add a suffix to a bunch of files?
- Organization: Unix in NYC
- Date: Sun, 13 Sep 1992 23:38:42 GMT
- Message-ID: <1992Sep13.233842.28641@jpradley.jpr.com>
- Keywords: shell, script, files, names
- References: <1992Sep3.213646.26527@msc.cornell.edu>
- Lines: 17
-
- In article <1992Sep3.213646.26527@msc.cornell.edu> dchin@tamar.msc.cornell.edu (David W. Chin) writes:
- >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
- >
-
-
- ls cat1 | xargs -iDWChin mv DWChin DWChin.1
- --
- Jean-Pierre Radley Unix in NYC jpr@jpr.com jpradley!jpr CIS: 72160,1341
-