changing 1st 3 characters of the file name!?

Hello Freinds,

I have a file with name ABC123456. and I need to change this to X123456.

Please tell me how can I do this?

Thank you.

mv ABC123456 X123456

If that doesn't do it for you, you'll have to be more specific on what you need.

pls be specific ...

mv abc123456 x123456

Thanks for your reply but i dont want the other name to go...

dont think about file.. I just need to change the name from ABC12345 to X12345 but i should have ABC12345 also in my directory...

that means considering 2 variables

VAR1=ABC12345

VAR2=X12345 i should get.

and if I print $VAR1 and $VAR2 i should get the respective output...

Thank you

As long as it's always the same substitution:

VAR1="ABC123456"
VAR2=$( echo "$VAR1" | sed -e 's/^ABC/X/' )

If you want to change any 3 characters:

VAR1="ABC123456"
VAR2=$( echo "$VAR1" | sed -e 's/^.../X/' )

Thanks freind..working great