<?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: run script in sequence in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/run-script-in-sequence/m-p/5088918#M442016</link>
    <description>&lt;!--!*#--&gt;&amp;gt;cat /tmp/*.txt |grep .... ; do ...&lt;BR /&gt;&lt;BR /&gt;You do know that grep can take a list of files.  And depending on whether you want the name of the file in the output, you can either use cat(1) or use grep -h to suppress.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;sometimes there are more than one .txt file in it, in this case the result is not correct (because the script cat the content for all *.txt file by one time)&lt;BR /&gt;&lt;BR /&gt;You need to explain why it isn't correct or provide more of your script fragment.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;to make sure the files are read in sequence (so that they write the correct thing to file ),&lt;BR /&gt;&lt;BR /&gt;Sequence is alphabetically.  What is the correct thing to write?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;that mean the script will process every file for one time only.&lt;BR /&gt;&lt;BR /&gt;You can also do that with a "for" loop.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;what I want is when run my_script&lt;BR /&gt;$ my_script /tmp&lt;BR /&gt;&lt;BR /&gt;If you want to process each file separately you can do:&lt;BR /&gt;for file in $1/*.txt; do&lt;BR /&gt;   grep ... $file ...&lt;BR /&gt;done</description>
    <pubDate>Tue, 22 Jan 2008 02:24:07 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-01-22T02:24:07Z</dc:date>
    <item>
      <title>run script in sequence</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-script-in-sequence/m-p/5088917#M442015</link>
      <description>I have a script to read the .txt file in /tmp , the script will read the file content then write something to the file  ( write different thing to different file depend the file content ) &lt;BR /&gt;&lt;BR /&gt;cat  /tmp/*.txt |grep .... ; do ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;suppose there should only have one .txt file in /tmp ,  it works fine if there is only one .txt file   , but however ,  sometimes there are more than one .txt file in it , in this case the result is not correct ( becuase the script cat the content for all *.txt file by one time) , so I would like to ask is there any way that when run  my script it first check the existence of *.txt files , to make sure the files are read in sequence ( so that they write the correct thing to file ) , that mean the script will process every file for one time only .&lt;BR /&gt;&lt;BR /&gt;for example&lt;BR /&gt;&lt;BR /&gt;if there is one .txt file in /tmp&lt;BR /&gt;$ls /tmp&lt;BR /&gt;aaa.txt&lt;BR /&gt;&lt;BR /&gt;when run my_script&lt;BR /&gt;$my_script /tmp&lt;BR /&gt;then it run my_script aaa.txt , it works fine&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But , if in case there are 3 .txt files in /tmp&lt;BR /&gt;&lt;BR /&gt;$ls /tmp&lt;BR /&gt;bbb.txt&lt;BR /&gt;ccc.txt&lt;BR /&gt;ddd.txt&lt;BR /&gt;&lt;BR /&gt;when run my_script&lt;BR /&gt;$my_script /tmp&lt;BR /&gt;it will cat bbb.txt ccc.bbb.txt ddd.txt to find some content , then write it to each file , so the result is not correct.&lt;BR /&gt;&lt;BR /&gt;what I want is when run my_script&lt;BR /&gt;$my_script /tmp&lt;BR /&gt;it run my_script bbb.txt , my_script ccc.txt &amp;amp; my_script ddd.txt separately,&lt;BR /&gt;&lt;BR /&gt;can advise what can i do ? thx</description>
      <pubDate>Tue, 22 Jan 2008 02:08:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-script-in-sequence/m-p/5088917#M442015</guid>
      <dc:creator>haeman</dc:creator>
      <dc:date>2008-01-22T02:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: run script in sequence</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-script-in-sequence/m-p/5088918#M442016</link>
      <description>&lt;!--!*#--&gt;&amp;gt;cat /tmp/*.txt |grep .... ; do ...&lt;BR /&gt;&lt;BR /&gt;You do know that grep can take a list of files.  And depending on whether you want the name of the file in the output, you can either use cat(1) or use grep -h to suppress.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;sometimes there are more than one .txt file in it, in this case the result is not correct (because the script cat the content for all *.txt file by one time)&lt;BR /&gt;&lt;BR /&gt;You need to explain why it isn't correct or provide more of your script fragment.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;to make sure the files are read in sequence (so that they write the correct thing to file ),&lt;BR /&gt;&lt;BR /&gt;Sequence is alphabetically.  What is the correct thing to write?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;that mean the script will process every file for one time only.&lt;BR /&gt;&lt;BR /&gt;You can also do that with a "for" loop.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;what I want is when run my_script&lt;BR /&gt;$ my_script /tmp&lt;BR /&gt;&lt;BR /&gt;If you want to process each file separately you can do:&lt;BR /&gt;for file in $1/*.txt; do&lt;BR /&gt;   grep ... $file ...&lt;BR /&gt;done</description>
      <pubDate>Tue, 22 Jan 2008 02:24:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-script-in-sequence/m-p/5088918#M442016</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-01-22T02:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: run script in sequence</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/run-script-in-sequence/m-p/5088919#M442017</link>
      <description>Thx</description>
      <pubDate>Tue, 22 Jan 2008 08:02:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/run-script-in-sequence/m-p/5088919#M442017</guid>
      <dc:creator>haeman</dc:creator>
      <dc:date>2008-01-22T08:02:45Z</dc:date>
    </item>
  </channel>
</rss>

