![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using a pipe with find .... -exec ... | pmallas | UNIX for Advanced & Expert Users | 1 | 01-29-2008 05:14 PM |
| query about find and -exec | shriashishpatil | UNIX for Advanced & Expert Users | 2 | 04-12-2007 01:16 AM |
| result of find | mpang_ | Shell Programming and Scripting | 1 | 05-01-2006 11:00 PM |
| find and exec | big123456 | UNIX for Advanced & Expert Users | 2 | 01-02-2006 12:10 PM |
| find . -type d -exec cd {} \; | shimont | UNIX for Dummies Questions & Answers | 2 | 11-23-2005 11:42 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi All,
I probably miss something fundamental here. I want to rename a bunch of files in subdirectories (that might contain white spaces) with names that are related. I thought following could do the job: Code:
find . -name *.sh -exec mv {} $(echo {} | sed -e 's/0/1/g') \;
Code:
find . -name *.sh -exec echo {} $(echo {} | sed -e 's/0/1/g') \;
It looks like the substitution of {} is somehow not done in the order I expected. If I try the pipelining directly (without ${..}) it generates the right substitution (but for my purpose not usable): Code:
find . -name *.sh -exec echo {} $(echo "2001" | sed -e 's/0/1/g') \;
best, blued |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|