I have files that are named front1.txt to front999.txt. They are all in the same directory. To change "front" to "back", I am doing something like this.
for file in .txt; do
new=`echo $file | sed 's/^[a-z]*[A-Z]/back/g'`
mv $file $new
done
My problem is what if files are named 1front1.txt to 999front999.txt? How would I just change the "front" part of the string?
kduffin, I think that csejl is just playing yo-yo with us. But if you want to play, you're supposed to nail only the the 2nd occurrence of "front" while leaving occurrences 1 and 3 intact. :rolleyes:
Of course, csejl will then come back and say "what I really meant..."