Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rate Thread Display Modes
Old 01-17-2003, 06:59 PM   #1
bkuchta
Prospect
 
Join Date: Sep 2002
Posts: 3
Replace string in item names including subdirectories?

I was wondering if anyone knew of a way to replace a certain string of text in the item names of every item in a directory, including subdirectories. This would include the name of the directories and subdirectories themselves. Apple has an applescript that does this for items in a single directory (no subdirectories) and they had one that worked in OS9 with subdirectores. (The OS9 one doesn't work in X. It makes a list of the paths of all item's in the directory, and once it changes the name of a subdirectory, it can't locate the files witin it.)

So anyway... I was wondering if anyone knew of a command line app built into OSX that could accomplish this task, or could create an applescript to the same effect.

Any help is appreciated. Thanks,

Brandon
bkuchta is offline   Reply With Quote
Old 01-18-2003, 05:25 AM   #2
filipp
Prospect
 
Join Date: Jan 2003
Location: estonia
Posts: 5
Sorry I don't remember the
exact syntax, but this can easily be accomplished
with a tcsh foreach lopp, grep and mv I think.

Check "man tcsh" or "man foreach"
filipp is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.