• Post Reply Bookmark Topic Watch Topic
  • New Topic

Shell Script  RSS feed

 
vidhya subramaniam
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to write a shell script that will search for a string and replace it with another string. Is there any command in K shell that can do this operation. I need to replace http://xml.cxml.org/schemas/cXML/1.1.008/cXML.dtd"with a local file specification.
Thanks,
Vidhya.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends a bit where you want to replace the string(s). The obvious choice is "sed" :-
sed 's$http://xml.cxml.org/schemas/cXML/1.1.008/cXML.dtd$whatever$g' <oldfile.xml >newfile.xml
should do the trick. Try "man sed" for more details. If that's not what you want, please let us know a few more details about the files you want to change, and maybe we can give a bit more help.
Grr. UBB ate my less-than
[ April 08, 2002: Message edited by: Frank Carver ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!