<?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: sed search and replace in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125438#M688418</link>
    <description>&amp;gt;Hey Dennis your does not seem to work.&lt;BR /&gt;&lt;BR /&gt;Because I was matching the explicit "." you had.&lt;BR /&gt;&lt;BR /&gt;Try this, it uses the [^"] trick:&lt;BR /&gt;&lt;BR /&gt;sed -e 's;".*/styleAssets/[^"]*";"&lt;A href="http://mydomain.com/styleAssets" target="_blank"&gt;http://mydomain.com/styleAssets&lt;/A&gt;";' \&lt;BR /&gt;    -e "s;'.*/styleAssets/[^']*';'&lt;A href="http://mydomain.com/styleAssets';" target="_blank"&gt;http://mydomain.com/styleAssets';&lt;/A&gt;"  $i</description>
    <pubDate>Fri, 22 Aug 2008 12:09:00 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-08-22T12:09:00Z</dc:date>
    <item>
      <title>sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125426#M688406</link>
      <description>I have been looking for a solution for this, but can't find one.&lt;BR /&gt;&lt;BR /&gt;I have a lot of .html files that i need to edit though crontab.&lt;BR /&gt;&lt;BR /&gt;This is the string I am looking for:&lt;BR /&gt;src="*../something/styleAssets.somthing.something*"&lt;BR /&gt;src='*../something/styleAssets.somthing.something*'&lt;BR /&gt;href="*../something/styleAssets.somthing.something*"&lt;BR /&gt;href='*../something/styleAssets.somthing.something*'&lt;BR /&gt;&lt;BR /&gt;to be replaced with a string:&lt;BR /&gt;http:/mydomain.com/styleAssets&lt;BR /&gt;&lt;BR /&gt;I were thinking of something like this:&lt;BR /&gt;&lt;BR /&gt;for i in $(find /www/myDir -type f -name '*.html')&lt;BR /&gt;do&lt;BR /&gt;sed -e 's/styleAssets/http:\/\/mydomain.com\/styleAssets/g' $i &amp;gt; $i.new&lt;BR /&gt;cp $i.nw $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;But that is not correct since i need to replace all within the single or double quote.&lt;BR /&gt;&lt;BR /&gt;tnx.</description>
      <pubDate>Tue, 19 Aug 2008 06:55:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125426#M688406</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2008-08-19T06:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125427#M688407</link>
      <description>It would help if you provided a line or 2 of the actual text which included the string(s) you want to replace.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Aug 2008 07:37:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125427#M688407</guid>
      <dc:creator>OFC_EDM</dc:creator>
      <dc:date>2008-08-19T07:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125428#M688408</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Try using escape characters.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://archives.devshed.com/forums/unix-linux-135/sed-regular-expression-search-replace-help-373459.html" target="_blank"&gt;http://archives.devshed.com/forums/unix-linux-135/sed-regular-expression-search-replace-help-373459.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unix.com/shell-programming-scripting/44886-shell-script-find-replace-string-multiple-files.html" target="_blank"&gt;http://www.unix.com/shell-programming-scripting/44886-shell-script-find-replace-string-multiple-files.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.jonasblog.com/2006/05/search-and-replace-in-all-files-within-a-directory-recursively.html" target="_blank"&gt;http://www.jonasblog.com/2006/05/search-and-replace-in-all-files-within-a-directory-recursively.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I think one of the links will work for you.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 19 Aug 2008 07:39:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125428#M688408</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2008-08-19T07:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125429#M688409</link>
      <description>Hey Kevin&lt;BR /&gt;&lt;BR /&gt;text:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&amp;gt;&lt;BR /&gt; &lt;!-- InstanceBeginEditable name="doctitle" --&gt;&lt;BR /&gt; &lt;TITLE&gt;menu&lt;/TITLE&gt;&lt;BR /&gt; &lt;!-- InstanceEndEditable --&gt;&lt;BR /&gt; &lt;!-- Framework CSS --&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" href="https://community.hpe.com/../styleAssets/bp/screen.css" type="text/css" media="screen, projection" /&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" href="https://community.hpe.com/../styleAssets/bp/print.css" type="text/css" media="print" /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;!--[if IE]&gt;&lt;link rel="stylesheet" href="bp/ie.css" type="text/css" media="screen, projection"&gt;&lt;![endif]--&gt;&lt;BR /&gt; &lt;!-- Issuu CSS --&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" href="https://community.hpe.com/../styleAssets/global_canvas.css" type="text/css" media="screen, projection" /&gt;&lt;BR /&gt; &lt;!-- InstanceBeginEditable name="css" --&gt;&lt;!-- InstanceEndEditable --&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;should bee changed to something like this.&lt;BR /&gt;&lt;BR /&gt; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&amp;gt;&lt;BR /&gt; &lt;!-- InstanceBeginEditable name="doctitle" --&gt;&lt;BR /&gt; &lt;TITLE&gt;menu&lt;/TITLE&gt;&lt;BR /&gt; &lt;!-- InstanceEndEditable --&gt;&lt;BR /&gt; &lt;!-- Framework CSS --&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" href="http://mydomain.com/styleAssets" type="text/css" media="screen, projection" /&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" href="http://mydomain.com/styleAssets" type="text/css" media="print" /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;!--[if IE]&gt;&lt;link rel="stylesheet" href="http://mydomain.com/styleAssets" type="text/css" media="screen, projection"&gt;&lt;![endif]--&gt;&lt;BR /&gt; &lt;!-- Issuu CSS --&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" href="http://mydomain.com/styleAssets" type="text/css" media="screen, projection" /&gt;&lt;BR /&gt; &lt;!-- InstanceBeginEditable name="css" --&gt;&lt;!-- InstanceEndEditable --&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And only if the reference hold the text styleAssets to begin with.&lt;BR /&gt;&lt;BR /&gt;BR jt</description>
      <pubDate>Tue, 19 Aug 2008 08:39:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125429#M688409</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2008-08-19T08:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125430#M688410</link>
      <description>Try these:&lt;BR /&gt;sed -e 's;".*/styleAssets\..*\..*\..*";"&lt;A href="http://mydomain.com/styleAssets" target="_blank"&gt;http://mydomain.com/styleAssets&lt;/A&gt;";g' \&lt;BR /&gt;    -e "s;'.*/styleAssets\\..*\\..*\\..*';'&lt;A href="http://mydomain.com/styleAssets';g" target="_blank"&gt;http://mydomain.com/styleAssets';g&lt;/A&gt;" \&lt;BR /&gt;$i</description>
      <pubDate>Tue, 19 Aug 2008 09:18:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125430#M688410</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-08-19T09:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125431#M688411</link>
      <description>I have some of the solution...&lt;BR /&gt;&lt;BR /&gt;Input file:&lt;BR /&gt; &lt;LINK rel="stylesheet" src="https://community.hpe.com/../otherplace/test.css" type="text/css" media="screen, projection" /&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" href="https://community.hpe.com/../otherplace/test.css" type="text/css" media="screen, projection" /&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" src="https://community.hpe.com/../styleAssets/global_canvas.css" type="text/css" media="screen, projection" /&gt;&lt;BR /&gt; &lt;LINK rel="stylesheet" href="https://community.hpe.com/../styleAssets/global_canvas.css" type="text/css" media="screen, projection" /&gt;&lt;BR /&gt;&lt;BR /&gt;Perl script href.pl:&lt;BR /&gt;s/href=(["'][^"']+["'])/href=\"http:\/\/mydomain.com\/styleAssets\"/ig&lt;BR /&gt;&lt;BR /&gt;Perl script src.pl:&lt;BR /&gt;s/src=(["'][^"']+["'])/src=\"http:\/\/mydomain.com\/styleAssets\"/ig&lt;BR /&gt;&lt;BR /&gt;The run script:&lt;BR /&gt;for i in $(find ./ -type f -name '*.html')&lt;BR /&gt;do&lt;BR /&gt; perl -p -i.old1 href.pl $i&lt;BR /&gt; perl -p -i.old2 scr.pl $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;But this solution also change lines witch does not hold a reference to styleAssets.&lt;BR /&gt;&lt;BR /&gt;I need some "if" statement in the perl script.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Aug 2008 09:59:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125431#M688411</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2008-08-19T09:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125432#M688412</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's{((src|href)=")\.\..([^"]+")}{$1http:/mydomain.com/$2}' file&lt;BR /&gt;&lt;BR /&gt;...which also preserves the original file as "file.old".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 19 Aug 2008 10:14:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125432#M688412</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-08-19T10:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125433#M688413</link>
      <description>Hey Dennis your does not seem to work.&lt;BR /&gt;Hey James your perl works partly except that it changes everything between the quotes even if it does not hold the word styleAssets.&lt;BR /&gt;&lt;BR /&gt;I'm trying to make the changes but it seems that I need some help with that.</description>
      <pubDate>Wed, 20 Aug 2008 07:12:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125433#M688413</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2008-08-20T07:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125434#M688414</link>
      <description>Hi (again) Jannik:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Hey James your perl works partly except that it changes everything between the quotes even if it does not hold the word styleAssets.&lt;BR /&gt;&lt;BR /&gt;Oops, sorry about that.&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's{((?:src|href)=")\.\.(/styleAssets[^"])}{$1http:/mydomain.com$2}' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 20 Aug 2008 08:30:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125434#M688414</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-08-20T08:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125435#M688415</link>
      <description>If have the string thanks James.&lt;BR /&gt;&lt;BR /&gt;Perl file (file.pl):&lt;BR /&gt;s/(href|src)(=["']).+(tyleAssets)/\1\2http:\/\/mydomain.com\/s\3/ig&lt;BR /&gt;&lt;BR /&gt;Run command:&lt;BR /&gt;for i in $(find ./ -type f -name '*.html')&lt;BR /&gt;do&lt;BR /&gt; perl -p -i.old file.pl $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
      <pubDate>Wed, 20 Aug 2008 10:41:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125435#M688415</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2008-08-20T10:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125436#M688416</link>
      <description>I will keep the tread open; if somebody find a better solution or a sed solution that works please post it.&lt;BR /&gt;&lt;BR /&gt;I will try to work on the post from Kevin.</description>
      <pubDate>Wed, 20 Aug 2008 10:46:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125436#M688416</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2008-08-20T10:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125437#M688417</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat filename&lt;BR /&gt;src="*../something/styleAssets.somthing.something*"&lt;BR /&gt;src='*../something/styleAssets.somthing.something*'&lt;BR /&gt;href="*../something/styleAssets.somthing.something*"&lt;BR /&gt;href='*../something/styleAssets.somthing.something*'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sed 's/\*.*styleAssets.*$/http\:\/mydomain.com\/styleAssets"/g' filename&lt;BR /&gt;&lt;BR /&gt;rgds.</description>
      <pubDate>Wed, 20 Aug 2008 12:36:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125437#M688417</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2008-08-20T12:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125438#M688418</link>
      <description>&amp;gt;Hey Dennis your does not seem to work.&lt;BR /&gt;&lt;BR /&gt;Because I was matching the explicit "." you had.&lt;BR /&gt;&lt;BR /&gt;Try this, it uses the [^"] trick:&lt;BR /&gt;&lt;BR /&gt;sed -e 's;".*/styleAssets/[^"]*";"&lt;A href="http://mydomain.com/styleAssets" target="_blank"&gt;http://mydomain.com/styleAssets&lt;/A&gt;";' \&lt;BR /&gt;    -e "s;'.*/styleAssets/[^']*';'&lt;A href="http://mydomain.com/styleAssets';" target="_blank"&gt;http://mydomain.com/styleAssets';&lt;/A&gt;"  $i</description>
      <pubDate>Fri, 22 Aug 2008 12:09:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125438#M688418</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-08-22T12:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: sed search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125439#M688419</link>
      <description>tnx i went for the perl sollution.</description>
      <pubDate>Wed, 24 Sep 2008 11:12:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-search-and-replace/m-p/5125439#M688419</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2008-09-24T11:12:23Z</dc:date>
    </item>
  </channel>
</rss>

