Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!umd5!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.questions Subject: Need a file renaming facility Message-ID: <13238@brl-adm.ARPA> Date: 3 May 88 20:07:14 GMT Sender: news@brl-adm.ARPA Lines: 33 From: Gary Benson Hello, Good morning, Mister Benson, I see you're doing well... Now I want to rename all those ".pre" files to the same name without ".pre". As usual, Doug Gwyn posted the quickest, most succinct, and most universal solution (I do say something nice about him every once in awhile :-). Some of the other solutions that were posted were incredibly unwieldy, and their posters should rethink their approach to the problem. Repent heathens! However, for those of us with the csh, there is yet another solution: foreach x (*.pre) mv $x $x:r end This may be typed directly into the shell, but only works with suffixes delimited with dots. Multiple dots work, so `set x=a.b.c; echo $x:r' yields `a.b'. You may add the -f or -i flags directly to mv if desired. Gary Benson -_-_-_-_-_-_-_-_-inc@tc.fluke.com_-_-_-_-_-_-_-_ Publication Services Ensign Benson, Space Cadet, Digital Circus, Sector R John Fluke Mfg. Co. Inc. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 The opinions expressed are solely my own and do not reflect NBS policy or agreement Sign my PETITION.