<?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 Re: Replace in a string in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178952#M50857</link>
    <description>Hum&lt;BR /&gt;&lt;BR /&gt;ok. But if the replace string is &lt;BR /&gt;/su01/bazar/ &lt;BR /&gt;instead of /logs_backup/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/logs/test/1/xxxx&lt;BR /&gt;=&amp;gt; /su01/bazar/test/1/xxxx&lt;BR /&gt;&lt;BR /&gt;Bests regards&lt;BR /&gt;Den</description>
    <pubDate>Wed, 03 Jun 2009 11:55:18 GMT</pubDate>
    <dc:creator>Leo The Cat</dc:creator>
    <dc:date>2009-06-03T11:55:18Z</dc:date>
    <item>
      <title>Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178947#M50852</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I've this in input&lt;BR /&gt;&lt;BR /&gt;/logs/test/1/xxxx&lt;BR /&gt;&lt;BR /&gt;I'd like to replace &lt;BR /&gt;/logs/ &lt;BR /&gt;by &lt;BR /&gt;/logs_backup/&lt;BR /&gt;&lt;BR /&gt;The result must be /logs_backup/test/1/xxxx&lt;BR /&gt;&lt;BR /&gt;How to do this small trick?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Den</description>
      <pubDate>Tue, 02 Jun 2009 17:15:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178947#M50852</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-02T17:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178948#M50853</link>
      <description>to be precise&lt;BR /&gt;&lt;BR /&gt;A=/logs/test/1/xxxx&lt;BR /&gt;A=Transformed_string($A)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now A = /logs_backup/test/1/xxxx&lt;BR /&gt;mkdir -p $A&lt;BR /&gt;&lt;BR /&gt;Something like that ....</description>
      <pubDate>Tue, 02 Jun 2009 17:52:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178948#M50853</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-02T17:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178949#M50854</link>
      <description>A=/logs/test&lt;BR /&gt;A=$(echo $A | sed 's/logs/logs_backup/')&lt;BR /&gt;&lt;BR /&gt;echo $A&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Jun 2009 17:58:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178949#M50854</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2009-06-02T17:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178950#M50855</link>
      <description>HUmmm&lt;BR /&gt;&lt;BR /&gt;Is this will replace only the first occurence ?&lt;BR /&gt;&lt;BR /&gt;Bests regards Ivan&lt;BR /&gt;Den</description>
      <pubDate>Tue, 02 Jun 2009 18:18:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178950#M50855</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-02T18:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178951#M50856</link>
      <description>Hi Den:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Is this will replace only the first occurence ?&lt;BR /&gt;&lt;BR /&gt;Well, yes on a line-by-line basis.  That is every _line_ in your input file will have the substitution performed _once_.&lt;BR /&gt;&lt;BR /&gt;If you add the 'g' flag to the substitution, then every occurance on every line will be replaced:&lt;BR /&gt;&lt;BR /&gt;# sed 's/logs/logs_backup/g' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 02 Jun 2009 18:39:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178951#M50856</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-02T18:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178952#M50857</link>
      <description>Hum&lt;BR /&gt;&lt;BR /&gt;ok. But if the replace string is &lt;BR /&gt;/su01/bazar/ &lt;BR /&gt;instead of /logs_backup/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/logs/test/1/xxxx&lt;BR /&gt;=&amp;gt; /su01/bazar/test/1/xxxx&lt;BR /&gt;&lt;BR /&gt;Bests regards&lt;BR /&gt;Den</description>
      <pubDate>Wed, 03 Jun 2009 11:55:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178952#M50857</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-03T11:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178953#M50858</link>
      <description>well, do the same thing, but this time, using the new string...what's wrong with that? have you tried it using sed?</description>
      <pubDate>Wed, 03 Jun 2009 13:33:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178953#M50858</guid>
      <dc:creator>ghostdog74</dc:creator>
      <dc:date>2009-06-03T13:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178954#M50859</link>
      <description>Hi Den:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ok. But if the replace string is &lt;BR /&gt;/su01/bazar/ &lt;BR /&gt;instead of /logs_backup/&lt;BR /&gt;&lt;BR /&gt;Escape the forward slashes like:&lt;BR /&gt;&lt;BR /&gt;# X=/logs/test/1/xxxx&lt;BR /&gt;# echo ${X}|sed -e 's/\/logs/\/su01\/bazar/g'&lt;BR /&gt;/su01/bazar/test/1/xxxx&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 03 Jun 2009 13:35:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178954#M50859</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-03T13:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Replace in a string</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178955#M50860</link>
      <description>Thanks to you Guys&lt;BR /&gt;Bests Regards&lt;BR /&gt;Den</description>
      <pubDate>Wed, 03 Jun 2009 14:46:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replace-in-a-string/m-p/5178955#M50860</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-06-03T14:46:52Z</dc:date>
    </item>
  </channel>
</rss>

