Well I am probably not sure about the second echo / read as it seems like a test for the user to read from the screen and then hopefully type in the correct name??
Other than that, are you able to provide more information about
The following script is not working
Are there error messages?
Are the wrong files being changed?
You need to be a lot more specific as a generic 'not working' is very ambiguous.
May I firstly suggest you type each line at the command line and see what happens? (exactly
what you have in your script)