<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic sed command to replace string in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983439#M782437</link>
    <description>Hello.&lt;BR /&gt;I grepped certain pattern and got below results: &lt;BR /&gt;WSS_80_err.mail:xyz@abb.com&lt;BR /&gt;WSS_81_err.mail:xyz@abb.com&lt;BR /&gt;WSS_82_err.mail:xyz@abb.com&lt;BR /&gt;WSS_83_err.mail:xyz@abb.com&lt;BR /&gt;WSS_ERR_80.mail:xyz@abb.com&lt;BR /&gt;WSS_ERR_81.mail:xyz@abb.com&lt;BR /&gt;WSS_ERR_82.mail:xyz@abb.com&lt;BR /&gt;WSS_ERR_83.mail:xyz@abb.com&lt;BR /&gt;&lt;BR /&gt;Now I wish to replace in *.* wherever xyz@abb.com is available with ' '. Could below command work fine or let me know the correct command:&lt;BR /&gt;&lt;BR /&gt;sed -n 's/xyz@abb.com//g' *.* &lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;</description>
    <pubDate>Wed, 07 Jun 2006 02:21:30 GMT</pubDate>
    <dc:creator>panchpan</dc:creator>
    <dc:date>2006-06-07T02:21:30Z</dc:date>
    <item>
      <title>sed command to replace string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983439#M782437</link>
      <description>Hello.&lt;BR /&gt;I grepped certain pattern and got below results: &lt;BR /&gt;WSS_80_err.mail:xyz@abb.com&lt;BR /&gt;WSS_81_err.mail:xyz@abb.com&lt;BR /&gt;WSS_82_err.mail:xyz@abb.com&lt;BR /&gt;WSS_83_err.mail:xyz@abb.com&lt;BR /&gt;WSS_ERR_80.mail:xyz@abb.com&lt;BR /&gt;WSS_ERR_81.mail:xyz@abb.com&lt;BR /&gt;WSS_ERR_82.mail:xyz@abb.com&lt;BR /&gt;WSS_ERR_83.mail:xyz@abb.com&lt;BR /&gt;&lt;BR /&gt;Now I wish to replace in *.* wherever xyz@abb.com is available with ' '. Could below command work fine or let me know the correct command:&lt;BR /&gt;&lt;BR /&gt;sed -n 's/xyz@abb.com//g' *.* &lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jun 2006 02:21:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983439#M782437</guid>
      <dc:creator>panchpan</dc:creator>
      <dc:date>2006-06-07T02:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: sed command to replace string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983440#M782438</link>
      <description>Depends what you really want. sed does not in-place edit your files, so if you want to change that pattern *inside* each file (note that *.* implies that all files are to have a dot in the name, so "README" will not be selected), sed needs a mv afterwards&lt;BR /&gt;&lt;BR /&gt;# sed 's/foo/bar/' &amp;lt; file &amp;gt; tmp&lt;BR /&gt;# mv tmp file&lt;BR /&gt;&lt;BR /&gt;In a loop that can be done like&lt;BR /&gt;&lt;BR /&gt;# for i in *.* ; do&lt;BR /&gt;&amp;gt; sed 's/foo/bar/' &amp;lt; $i &amp;gt; __$i.tmp_&lt;BR /&gt;&amp;gt; mv __$i.tmp_ $i&lt;BR /&gt;&amp;gt; done&lt;BR /&gt;&lt;BR /&gt;Or use perl instead, which *can* do in-file replacements&lt;BR /&gt;&lt;BR /&gt;# perl -pi -e's/foo/bar/' *.*&lt;BR /&gt;&lt;BR /&gt;in your case&lt;BR /&gt;&lt;BR /&gt;# perl -pi -e's/\bxyz\@abb.com\b//g' *.*&lt;BR /&gt;&lt;BR /&gt;Note that I made the pattern more safe by adding two \b (word bound) assertions, so zxyz@abb.com and/or xyz@abb.common will not match.&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 07 Jun 2006 02:47:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983440#M782438</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-06-07T02:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: sed command to replace string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983441#M782439</link>
      <description>Hi Panchalp,&lt;BR /&gt;&lt;BR /&gt;Did you mean that if you had&lt;BR /&gt;&lt;BR /&gt;WSS_80_err.mail:xyz@abb.com&lt;BR /&gt;WSS_81_err.mail:xyz@abb.com&lt;BR /&gt;WSS_82_err.mail:xyz@abb.com&lt;BR /&gt;WSS_83_err.mail:xyz@abb.com&lt;BR /&gt;&lt;BR /&gt;you wanted it to be as&lt;BR /&gt;&lt;BR /&gt;WSS_80_err.mail:*.*&lt;BR /&gt;WSS_81_err.mail:*.*&lt;BR /&gt;WSS_82_err.mail:*.*&lt;BR /&gt;WSS_83_err.mail:*.*&lt;BR /&gt;WSS_ERR_80.mail:*.*&lt;BR /&gt;&lt;BR /&gt;i.e. replace xyz@abb.com with *.*&lt;BR /&gt;&lt;BR /&gt;Then use this.&lt;BR /&gt;cat filename | sed 's/xyz@abb.com/*.*/g'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IA&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jun 2006 03:05:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983441#M782439</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2006-06-07T03:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: sed command to replace string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983442#M782440</link>
      <description>I liked &lt;BR /&gt;# perl -pi -e's/\bxyz\@abb.com\b//g' *.*&lt;BR /&gt;&lt;BR /&gt;But it has replaced x_yz@abb.com also :-(&lt;BR /&gt;&lt;BR /&gt;Please advise...consider i have fix one i.e. xyz.abc@abb.com&lt;BR /&gt;&lt;BR /&gt;Thank you.</description>
      <pubDate>Wed, 07 Jun 2006 03:05:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983442#M782440</guid>
      <dc:creator>panchpan</dc:creator>
      <dc:date>2006-06-07T03:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: sed command to replace string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983443#M782441</link>
      <description>I thank you all for their time and help.</description>
      <pubDate>Wed, 07 Jun 2006 04:46:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command-to-replace-string/m-p/4983443#M782441</guid>
      <dc:creator>panchpan</dc:creator>
      <dc:date>2006-06-07T04:46:22Z</dc:date>
    </item>
  </channel>
</rss>

