<?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: Interesting Scripting Question - Stdout and File Recreation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662229#M929596</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;sorry, but you will indeed need an intermediate file if you use redirection.&lt;BR /&gt;&lt;BR /&gt;If you really do not want an extra file, you could use and ed script:&lt;BR /&gt;&lt;BR /&gt;ed yourfile &amp;lt;&amp;lt; [EOT]&lt;BR /&gt;,g/searchstring/d&lt;BR /&gt;w&lt;BR /&gt;q&lt;BR /&gt;[EOT]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.</description>
    <pubDate>Mon, 11 Feb 2002 11:08:16 GMT</pubDate>
    <dc:creator>Thierry Poels_1</dc:creator>
    <dc:date>2002-02-11T11:08:16Z</dc:date>
    <item>
      <title>Interesting Scripting Question - Stdout and File Recreation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662227#M929594</link>
      <description>Pop quiz,...&lt;BR /&gt;&lt;BR /&gt;I know we can recreate a Variable and re-assign the value directly,&lt;BR /&gt;&lt;BR /&gt;eg. export PATH=$PATH":/tmp"&lt;BR /&gt;&lt;BR /&gt;BUT! Can I do the same in one command for a log file?&lt;BR /&gt;&lt;BR /&gt;eg. grep -v "Alpha" /tmp/file1 &amp;gt;/tmp/file1&lt;BR /&gt;&lt;BR /&gt;Or am I resigned to 2 commands?&lt;BR /&gt;eg. grep -v "Alpha" /tmp/file1 &amp;gt;/tmp/file2&lt;BR /&gt;    mv /tmp/file2 /tmp/file1&lt;BR /&gt;&lt;BR /&gt;Share and Enjoy! Ian&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Feb 2002 10:45:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662227#M929594</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-02-11T10:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting Scripting Question - Stdout and File Recreation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662228#M929595</link>
      <description>Hi Ian,&lt;BR /&gt;&lt;BR /&gt;If you do:&lt;BR /&gt;grep -v "Alpha" /tmp/file1 |tee /tmp/file1&lt;BR /&gt;&lt;BR /&gt;Works Fine!!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
      <pubDate>Mon, 11 Feb 2002 11:06:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662228#M929595</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2002-02-11T11:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting Scripting Question - Stdout and File Recreation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662229#M929596</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;sorry, but you will indeed need an intermediate file if you use redirection.&lt;BR /&gt;&lt;BR /&gt;If you really do not want an extra file, you could use and ed script:&lt;BR /&gt;&lt;BR /&gt;ed yourfile &amp;lt;&amp;lt; [EOT]&lt;BR /&gt;,g/searchstring/d&lt;BR /&gt;w&lt;BR /&gt;q&lt;BR /&gt;[EOT]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.</description>
      <pubDate>Mon, 11 Feb 2002 11:08:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662229#M929596</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2002-02-11T11:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting Scripting Question - Stdout and File Recreation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662230#M929597</link>
      <description>We have a winner !!  (read as 10-pointer ;-)&lt;BR /&gt;The tee trick indeed does the trick perfectly.&lt;BR /&gt;&lt;BR /&gt;Just add "&amp;gt; /dev/null" to get rid of the output on screen (don't know how big the file is).&lt;BR /&gt;grep -v "Alpha" /tmp/file1 |tee /tmp/file1 &amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Thierry</description>
      <pubDate>Mon, 11 Feb 2002 11:13:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662230#M929597</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2002-02-11T11:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting Scripting Question - Stdout and File Recreation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662231#M929598</link>
      <description>Magic answers both! Thanks gentlemen, much appreciated!&lt;BR /&gt;&lt;BR /&gt;Ian</description>
      <pubDate>Mon, 11 Feb 2002 11:21:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662231#M929598</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-02-11T11:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting Scripting Question - Stdout and File Recreation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662232#M929599</link>
      <description>Hi Again,&lt;BR /&gt;&lt;BR /&gt;You are welcome Mister.&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
      <pubDate>Mon, 11 Feb 2002 11:44:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662232#M929599</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2002-02-11T11:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting Scripting Question - Stdout and File Recreation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662233#M929600</link>
      <description>Ian,&lt;BR /&gt;&lt;BR /&gt;Be aware that the tee trick only works for small amounts of data.&lt;BR /&gt;&lt;BR /&gt;tee is useful because you specify the output filename as an argument, if you had to use &amp;gt; &lt;FILENAME&gt; then the shell truncates it before any processing begins. However tee is actually reading and writing the same file and at some point the write process will effectively truncate the file and you will lose data.&lt;BR /&gt;&lt;BR /&gt;Some tests that I have done indicate that you will get away with writing between 18 and 24Kb but personally I wouldn't trust it unless you're sure that the input file is very small.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;/FILENAME&gt;</description>
      <pubDate>Mon, 11 Feb 2002 12:31:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662233#M929600</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-02-11T12:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting Scripting Question - Stdout and File Recreation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662234#M929601</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Thanks for the warning, will definitely check sizings before using this methodology.&lt;BR /&gt;&lt;BR /&gt;Ian</description>
      <pubDate>Mon, 11 Feb 2002 12:36:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-scripting-question-stdout-and-file-recreation/m-p/2662234#M929601</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-02-11T12:36:36Z</dc:date>
    </item>
  </channel>
</rss>

