Bash - change many file names in one-line for loop (for and mv)

21 Jan 2018

for file in *.jpg ; do mv $file ${file//IMG/NEWPAT} ; done


NB to create array on the fly:
for chromo in ( "chr"{1..22} ); do echo $chromo; done

[ bash  loop  ]