Changing file names

I have lot of files whose names are something like the following. I want to change the name of all the files from 'npt02' to 'n02'.

npt02-z30-sr65-rgdt0p50-dc0p01-16x12drw.tpf
npt02-z30-sr65-rgdt0p50-dc0p01-8x6drw.back
npt02-z30-sr65-rgdt0p50-dc0p01-8x6drw-bst-mis.xy
npt02-z30-sr65-rgdt0p50-dc0p01-8x6drw.cmod
npt02-z30-sr65-rgdt0p50-dc0p01-8x6drw.expl
npt02-z30-sr65-rgdt0p50-dc0p01-8x6drw.log
npt02-z30-sr65-rgdt0p50-dc0p01-8x6drw.ps
npt02-z30-sr65-rgdt0p50-dc0p01-8x6drw-rms-mis.xy
npt02-z30-sr65-rgdt0p50-dc0p01-8x6drw.tpf
npt02-z30-sr65-rgdt0p50-dc0p03-8x6drw.back
npt02-z30-sr65-rgdt0p50-dc0p03-8x6drw-bst-mis.xy
npt02-z30-sr65-rgdt0p50-dc0p03-8x6drw.cmod
npt02-z30-sr65-rgdt0p50-dc0p03-8x6drw.expl
npt02-z30-sr65-rgdt0p50-dc0p03-8x6drw.log
npt02-z30-sr65-rgdt0p50-dc0p03-8x6drw.ps
npt02-z30-sr65-rgdt0p50-dc0p03-8x6drw-rms-mis.xy
npt02-z30-sr65-rgdt0p50-dc0p03-8x6drw.tpf
npt02-z30-sr65-rgdt0p50-dc0p05-4x3smp.cmod
npt02-z30-sr65-rgdt0p50-dc0p05-8x6drw.back
npt02-z30-sr65-rgdt0p50-dc0p05-8x6drw-bst-mis.xy
npt02-z30-sr65-rgdt0p50-dc0p05-8x6drw.cmod
npt02-z30-sr65-rgdt0p50-dc0p05-8x6drw.expl
npt02-z30-sr65-rgdt0p50-dc0p05-8x6drw.log
npt02-z30-sr65-rgdt0p50-dc0p05-8x6drw.ps
npt02-z30-sr65-rgdt0p50-dc0p05-8x6drw-rms-mis.xy
npt02-z30-sr65-rgdt0p50-dc0p05-8x6drw.tpf
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw.back
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw-bst-mis.xy
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw.cmod
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw.expl
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw.log
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw-mis.ps
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw.ps
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw-rms-mis.xy
npt02-z30-sr65-rgdt0p50-dc0p08-4x3drw.tpf

Try:

for i in npt02*; do
  mv "$i" "n${i#npt}" 
done

Another way, which should work for large numbers of files and also for filenames containing space characters:

ls npt02* | while read old_filename
do
        new_filename="echo "${filename}|sed -e "s/npt02/n02/g"
        mv "${old_filename}" "${new_filename}"
done

Actually the "for i in.." construct works for large numbers of files and also for file names containing space characters...

This will be in csh I would think, right?

Bourne shell I think

---------- Post updated at 06:21 PM ---------- Previous update was at 05:37 PM ----------

I am trying something like this at the moment. Want to pass findptn and replace it with replaceptn, but something is not working.

  foreach f ( * )
    echo $f `echo $f | awk -v findptn=$find -v replaceptn=$replace  /
                           '{sub(/findptn/,"replaceptn")}; 1'`
  end

Oops. If your "foreach" works you are actually running "C Shell" (csh) which is a quite different syntax from Bourne-type Shells such as "sh", "ksh", "bash" etc. .
On re-reading your last post I think that this is what you meant!

There is no real use for "csh" in unix/Linux Systems Administration. All system-supplied scripts will be written in a Bourne-type Shell relevant to the Operating System.

Sorry, cannot help is it is a detailed "csh" question.