Skip to main content
added 8 characters in body; edited title
Source Link

To delete a word in a line in file without deleting a whole line in linux

I want to delete a string "www.yahoo.com" only if the line starts with assign where host.name in [ and ends with ] and also if the string followedis followed by comma(,) i need  I need to delete that comma as well

assign where host.name in [ "www.google.com","www.yahoo.com","www.facebook.com" ] 

My output should lookslook like

assign where host.name in [ "www.google.com", "www.facebook.com" ] 

I dontdon't know how to achieve this, Kindly.  Kindly give me some idea about this code.

To delete a word in a line in file without deleting a whole line in linux

I want to delete a string "www.yahoo.com" only if the line starts with assign where host.name in [ and ends with ] and also if the string followed by comma(,) i need to delete that comma as well

assign where host.name in [ "www.google.com","www.yahoo.com","www.facebook.com" ] 

My output should looks like

assign where host.name in [ "www.google.com", "www.facebook.com" ] 

I dont know how to achieve this, Kindly give me some idea about this code

To delete a word in a line in file without deleting a whole line

I want to delete a string "www.yahoo.com" only if the line starts with assign where host.name in [ and ends with ] and also if the string is followed by comma(,)  I need to delete that comma as well

assign where host.name in [ "www.google.com","www.yahoo.com","www.facebook.com" ] 

My output should look like

assign where host.name in [ "www.google.com", "www.facebook.com" ] 

I don't know how to achieve this.  Kindly give me some idea about this code.

edited tags
Link
jojo
  • 11
  • 1
deleted 3 characters in body
Source Link
user147505
user147505
Loading
Source Link
jojo
  • 11
  • 1
Loading