I have hundreds of directories that I need to rename, as follows:from 15_bls to 15_adj_blsfrom 14_kies to 14_adj_kiesand so on...So, I have to insert 'adj' between the number and the word.What I have done, but it's not doing wellfor dic in [0-9]*dom=`echo $dic | cut -d_ -f1`l=`echo $dic | cut -d_ -f2`mv $dic ${m}_adj_${l}done 
Rename multiple directories inserting between
bash;shell script;rename
I could not see the problem in your script but not knowing all the directories you have, I don't know what you are facing. But something like this might help:find ./ -maxdepth 1 -type d | while read dirnamedo  newdirname=$(echo ${dirname} | sed -e 1,1s/_/_adj_/)  mv ${dirname} ${newdirname}done