Help needed in string manipulation

Hi,
Im a newbie to UNIX Shell Scripting.

I have a variable "filename" which contains the value "fileone.out". I need help in doing some string manipulation on this variable to change the extension alone and the result should be "fileone.txt", since i need to use this new value to refer another file.

Regards,
Amby.

old_name=fileone.out
new_name=${old_name%%.out}.txt

why %% is required? I tried without %%, hot an error. Can u explain :frowning:

-Chanakya

Look under 'Parameter Expansion' in man sh for ${parameter%%word}

Hi Vino,
Thanks a lot :slight_smile:
It worked.

Regards,
Amby.