foreach($i in $(ls *.obj |sed 's/ \ */\t/g' |cut -f 6 |uniq |grep -e '..$')) { $A=basename $(basename ${i}); mv ${A}'.c.obj' ${A}'.o' }