Skip to main content
added 199 characters in body
Source Link
disha
  • 17
  • 6

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.

The script should change the specific word as well as the file name eg: Input File name: cat home.txt (word to be replaced -->cat) OutPut Filename: Dog home.txt(Cat should be replaced with Dog)

Kindly help!

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!

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.

The script should change the specific word as well as the file name eg: Input File name: cat home.txt (word to be replaced -->cat) OutPut Filename: Dog home.txt(Cat should be replaced with Dog)

Kindly help!

added 40 characters in body
Source Link
disha
  • 17
  • 6

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!

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

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!

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!

Source Link
disha
  • 17
  • 6

Replacing the word(case senstitive) in a file

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

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!