<?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 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776232#M76060</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;try&lt;BR /&gt;&lt;BR /&gt;sed -e "s/$/ $INS/g" failed.log3 &amp;gt; failed.log4&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;          Steve Steel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;See&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unet.univie.ac.at/aix/cmds/aixcmds5/sed.htm" target="_blank"&gt;http://www.unet.univie.ac.at/aix/cmds/aixcmds5/sed.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt; copy an existing file (oldfile) to a new file (newfile) and replace all occurrences of the testpattern text string with the contents of the $REPL shell variable, enter: &lt;BR /&gt;cat oldfile | sed -e "s/testpattern/$REPL/g" &amp;gt; newfile&lt;BR /&gt;</description>
    <pubDate>Wed, 31 Jul 2002 06:08:18 GMT</pubDate>
    <dc:creator>Steve Steel</dc:creator>
    <dc:date>2002-07-31T06:08:18Z</dc:date>
    <item>
      <title>sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776230#M76058</link>
      <description>Dear Friend,&lt;BR /&gt;&lt;BR /&gt;How could I pass an argument to a sed ?&lt;BR /&gt;&lt;BR /&gt;INS=`cat failed.log8|awk '{print $1}'`&lt;BR /&gt;sed -e 's/$/ $INS/g' failed.log3 &amp;gt; failed.log4</description>
      <pubDate>Wed, 31 Jul 2002 05:16:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776230#M76058</guid>
      <dc:creator>System Dude_1</dc:creator>
      <dc:date>2002-07-31T05:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776231#M76059</link>
      <description>Only just learning sed my self.&lt;BR /&gt;&lt;BR /&gt;Have attached some examples someone gave me..&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Jul 2002 06:02:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776231#M76059</guid>
      <dc:creator>Paul Thomson_2</dc:creator>
      <dc:date>2002-07-31T06:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776232#M76060</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;try&lt;BR /&gt;&lt;BR /&gt;sed -e "s/$/ $INS/g" failed.log3 &amp;gt; failed.log4&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;          Steve Steel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;See&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unet.univie.ac.at/aix/cmds/aixcmds5/sed.htm" target="_blank"&gt;http://www.unet.univie.ac.at/aix/cmds/aixcmds5/sed.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt; copy an existing file (oldfile) to a new file (newfile) and replace all occurrences of the testpattern text string with the contents of the $REPL shell variable, enter: &lt;BR /&gt;cat oldfile | sed -e "s/testpattern/$REPL/g" &amp;gt; newfile&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Jul 2002 06:08:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776232#M76060</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-07-31T06:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776233#M76061</link>
      <description>You can also do it with ed (you don't need a temp-file with it) :&lt;BR /&gt;&lt;BR /&gt;replace_string()&lt;BR /&gt;{&lt;BR /&gt;  fname="$1"&lt;BR /&gt;  from="$2"&lt;BR /&gt;  to="$3"&lt;BR /&gt; &lt;BR /&gt;  ed -s $fname &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;1,$ s/$from/$to/g&lt;BR /&gt;w $fname&lt;BR /&gt;q&lt;BR /&gt;EOF&lt;BR /&gt;}</description>
      <pubDate>Wed, 31 Jul 2002 07:59:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776233#M76061</guid>
      <dc:creator>Systeemingenieurs Infoc</dc:creator>
      <dc:date>2002-07-31T07:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776234#M76062</link>
      <description>Though Steve's anwer is correct, he doesn't mention why /your/ answer is wrong: you are using single quotes, which makes $INS not expanding.&lt;BR /&gt;&lt;BR /&gt;The explanation can be found in the man page of the shell you are using&lt;BR /&gt;&lt;BR /&gt;Double quotes also interpolate backticks:&lt;BR /&gt;&lt;BR /&gt;l1:/u/usr/merijn/.elvislib 128 &amp;gt; echo "I'm at `pwd` now"&lt;BR /&gt;I'm at /u/usr/merijn/.elvislib now&lt;BR /&gt;l1:/u/usr/merijn/.elvislib 129 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;And your command can be a single pass:&lt;BR /&gt;&lt;BR /&gt;sed -e 's/$/ '`awk '{print $1}' &amp;lt; failed.log8`'/'  failed.log3 &amp;gt;failed.log4</description>
      <pubDate>Wed, 31 Jul 2002 08:16:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed/m-p/2776234#M76062</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-07-31T08:16:52Z</dc:date>
    </item>
  </channel>
</rss>

