Shell Scripting

Hello ,

Can any one suggest me that how copy only 3 characters and not more than that starting from "an"
As below
angio.txt
anbel.jpg
anheakla.txt

when i try to copy anheakla.txt should not get copied .
can some one suggest me ?

Could this help you ?

echo "angio.txt
anbel.jpg
anheakla.txt" | awk '/^an/{print substr($0,3,3)}'

Thanks Pravin,
I need a copy command which will copy only 3 characters after "an" not as anheakla.txt.
It should copy only angio.txt and anbel.jpg .

Hi

Not sure whether I understood your question:

cp an[a-z][a-z][a-z].*  target_dir

Guru.

Thanks Guru
Its working as expected...

cp an???.* todir

Thank you..
This is also working fine.

One more

cp an???.*