I am new to linux, I have one 200 lines in a file. In that file I need to replace the specific word
eg: **existing word: foo
 New word : bar**
I read some blogs...i understood it can be done with `sed`. But I do not know how to do that with a shell script

 sed 's/foo/bar/' /path to a file

I need to write a script, I do not know how to give the file as an input or should I store in a variable and change the specific word.

Kindly help!