![]() |
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 |
| Renaming multiple files | jayell | Shell Programming and Scripting | 7 | 01-12-2009 04:27 PM |
| Renaming multiple files | Jazmania | Shell Programming and Scripting | 6 | 01-02-2009 02:16 PM |
| Renaming Multiple files | dhiren_shah | UNIX for Dummies Questions & Answers | 2 | 09-12-2008 02:23 AM |
| Renaming multiple files | rmayur | UNIX for Dummies Questions & Answers | 6 | 02-26-2004 04:40 AM |
| Renaming multiple files | jxh461 | Shell Programming and Scripting | 4 | 04-01-2003 07:25 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Renaming Files (Multiple files)
Hi,
I have a directory with files names like ABC20090101AXY.txt, ABC20090102BZ.txt,ABC20090101COF.txt etc. The digits in the filenames represent the date. I want to rename the files to AXY.txt, BZ.txt and COF.txt I tried with this code. myfile= date '+ABC%Y%m%d' for i in *.txt do mv $i `echo $i | sed 's/$myfile//'` done But its giving message mv: ABC20090101AXY.txt and ABC20090101AXY.txt are identical Can u help me finding the problem. Regards, Shekhar |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|