<?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: Shell script question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377716#M196883</link>
    <description># setup the log file&lt;BR /&gt;LOG=/tmp/some.log&lt;BR /&gt;if [ -f $LOG ]&lt;BR /&gt;then&lt;BR /&gt;        mv $LOG $LOG.old&lt;BR /&gt;fi&lt;BR /&gt;cat /dev/null &amp;gt; $LOG&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
    <pubDate>Mon, 13 Sep 2004 07:32:19 GMT</pubDate>
    <dc:creator>Geoff Wild</dc:creator>
    <dc:date>2004-09-13T07:32:19Z</dc:date>
    <item>
      <title>Shell script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377715#M196882</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I need to create a new file within a shell script so that the new file may be then manipulated. I know the following :-&lt;BR /&gt;&lt;BR /&gt;cat &amp;gt; filename but this hangs. Can anyone suggest another means so that filename may then be copied or moved ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Jeff</description>
      <pubDate>Mon, 13 Sep 2004 07:28:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377715#M196882</guid>
      <dc:creator>Jeff Picton</dc:creator>
      <dc:date>2004-09-13T07:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377716#M196883</link>
      <description># setup the log file&lt;BR /&gt;LOG=/tmp/some.log&lt;BR /&gt;if [ -f $LOG ]&lt;BR /&gt;then&lt;BR /&gt;        mv $LOG $LOG.old&lt;BR /&gt;fi&lt;BR /&gt;cat /dev/null &amp;gt; $LOG&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Sep 2004 07:32:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377716#M196883</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-09-13T07:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377717#M196884</link>
      <description>The easiest way I could think is doing something as follows.&lt;BR /&gt;&lt;BR /&gt;touch file_name&lt;BR /&gt;echo "something" &amp;gt;&amp;gt; file&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Mon, 13 Sep 2004 07:34:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377717#M196884</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-09-13T07:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377718#M196885</link>
      <description>You can use touch command to create a file. But it will be used to update the file informations.&lt;BR /&gt;&lt;BR /&gt; touch filename&lt;BR /&gt; &lt;BR /&gt; touch &lt;TIMEINFORMATION&gt; filename&lt;BR /&gt;By simple you can create as,&lt;BR /&gt;&lt;BR /&gt; &amp;gt; filename&lt;BR /&gt;&lt;BR /&gt; or&lt;BR /&gt;&lt;BR /&gt; cp /dev/null filename&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; More you can create, file as,&lt;BR /&gt;&lt;BR /&gt; &amp;gt;| filename&lt;BR /&gt;&lt;BR /&gt; Where,&lt;BR /&gt;&lt;BR /&gt; &amp;gt;| used for when the file exists there. By default if you user &amp;gt; filename on &lt;BR /&gt;&lt;BR /&gt; set -o noclobber&lt;BR /&gt;&lt;BR /&gt; &amp;gt; filename &lt;BR /&gt; &lt;BR /&gt; will make error messages for existing files.&lt;BR /&gt; &lt;BR /&gt; So use&lt;BR /&gt;&lt;BR /&gt; &amp;gt;| filename &lt;BR /&gt;&lt;BR /&gt; to avoid error to update informations of file.&lt;BR /&gt;&lt;BR /&gt;REgards&lt;BR /&gt;Muthu&lt;BR /&gt;&lt;/TIMEINFORMATION&gt;</description>
      <pubDate>Mon, 13 Sep 2004 07:36:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377718#M196885</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-13T07:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377719#M196886</link>
      <description>Hi Jeff,&lt;BR /&gt;&lt;BR /&gt;'touch filename' will create a file if it doesn't exist already.&lt;BR /&gt;&lt;BR /&gt;Simply '&amp;gt; filename' will create a file and also empty it if it already exists.&lt;BR /&gt;&lt;BR /&gt;If you know what data you want it to contain, you can use cat with a 'here' document as follows:&lt;BR /&gt;cat &amp;gt; filename &amp;lt;&amp;lt; EOF&lt;BR /&gt;your&lt;BR /&gt;data&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;EOF is an arbitrary terminator, you can pretty much use whatever you like. See man sh-posix for full details.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Mon, 13 Sep 2004 07:37:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377719#M196886</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2004-09-13T07:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377720#M196887</link>
      <description>why are you trying cat &amp;gt; filename there,&lt;BR /&gt;&lt;BR /&gt; It may be used as,&lt;BR /&gt;&lt;BR /&gt; cat filename &amp;gt; newfilename&lt;BR /&gt; cat filename &amp;gt;| newfilename (noclobber mode)&lt;BR /&gt; &lt;BR /&gt; or &lt;BR /&gt;&lt;BR /&gt; cat filename &amp;gt;&amp;gt; newfilename&lt;BR /&gt;&lt;BR /&gt; It will append content.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; Else as,&lt;BR /&gt;&lt;BR /&gt; echo "test" | cat - &amp;gt; filename&lt;BR /&gt;&lt;BR /&gt; - --&amp;gt; collect all stdoutput message which got from pipe redirection.&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Sep 2004 07:41:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question/m-p/3377720#M196887</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-13T07:41:15Z</dc:date>
    </item>
  </channel>
</rss>

