Hi all,
I currently use this code to delete text from file names when they are dropped in a folder.
find . -type f | while read i;do [ "$i" != "${i//2009abc/}" ] && mv "$i" "${i//2009abc/}" ;done
I have four versions of the code that delete the unwanted text if it has 2006, 2007, 2008 and 2009 with other standard text in it in four different folders.
Is there a way that I could re-write the code so that for argument sake delete any date from say 1990 to 2009 with and any date before that leave it in.
For example;
Input: name of file 2009 abc.mov
Output: name of file.mov
Input: name of file 2008 abc.mov
Output: name of file.mov
Input: name of file 2007 abc.mov
Output: name of file.mov
Input: name of file 2006 abc.mov
Output: name of file.mov
Input: name of file 1987 abc.mov
Output: name of file 1987.mov
Is this possible?
Thanks in advance