|
How to remove numbers from filename
Hi all,
Can I edit this script:
Code:
find . -type f | while read i;do [ "$i" != "${i//abc/}" ] && mv "$i" "${i//abc/}" ;done
so that it will not only take out abc from the filename but also take out any numbers [Date, as in the year i.e. 2009 or any other year] that might be in the filename as well.
An example would be,
HTML Code:
Input:
filename abc 2009.mov
Output:
filename.mov
or
HTML Code:
Input:
filename.abc.2009.mov
Output:
filename.mov
Regards
Last edited by Monkey Dean; 05-07-2009 at 06:52 AM..
|