<?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: HELP needed with simple script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452782#M209059</link>
    <description>Aghhh, i like the # find /dir1 /dir2 /dir3 -type f -exec cat {} &amp;gt;&amp;gt;file \; and this should work a treat. Don't know why i didn't think of it - Mind block brought on by Christmas festivities &lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Thu, 30 Dec 2004 07:11:42 GMT</pubDate>
    <dc:creator>Declan Heerey</dc:creator>
    <dc:date>2004-12-30T07:11:42Z</dc:date>
    <item>
      <title>HELP needed with simple script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452777#M209054</link>
      <description>I need a simply solution to the following problem; I have a very basic script which i want to run against every directory in a list OR every directory below a root directory. For example at the moment i do the following &lt;BR /&gt;&lt;BR /&gt;cd /directory_1&lt;BR /&gt;for i in `ls *`&lt;BR /&gt;do&lt;BR /&gt;   cat $i &amp;gt;&amp;gt; file&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;cd /directory_2&lt;BR /&gt;for i in `ls *`&lt;BR /&gt;do&lt;BR /&gt;   cat $i &amp;gt;&amp;gt; file&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;etc etc &lt;BR /&gt;&lt;BR /&gt;Is there a way of doing this in one sweep? I ALSO need to concatenate the files in a particular order &lt;BR /&gt;&lt;BR /&gt;Thanks in advance - Declan</description>
      <pubDate>Thu, 30 Dec 2004 06:52:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452777#M209054</guid>
      <dc:creator>Declan Heerey</dc:creator>
      <dc:date>2004-12-30T06:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: HELP needed with simple script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452778#M209055</link>
      <description>If you want to cat all files from a root starting point then this works:&lt;BR /&gt;find /start -type f -exec cat {} &amp;gt;&amp;gt; file \;</description>
      <pubDate>Thu, 30 Dec 2004 07:02:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452778#M209055</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2004-12-30T07:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: HELP needed with simple script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452779#M209056</link>
      <description>Above can be done much faster as&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;---&lt;BR /&gt;cd /dir1&lt;BR /&gt;cat * &amp;gt;&amp;gt;file&lt;BR /&gt;&lt;BR /&gt;cd /dir2&lt;BR /&gt;cat * &amp;gt;&amp;gt;file&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;be sure that 'file' is not in any of these dir's, because that will yield unexpected errors&lt;BR /&gt;&lt;BR /&gt;be aware that '*' will exclude all files that start with a dot (.) and it includes directories, which might also not be what you want&lt;BR /&gt;&lt;BR /&gt;If the directories you want do not contain subfolders, you could do&lt;BR /&gt;&lt;BR /&gt;# find /dir1 /dir2 /dir3 -type f -exec cat {} &amp;gt;&amp;gt;file \;&lt;BR /&gt;&lt;BR /&gt;or if there are not too many files, faster&lt;BR /&gt;&lt;BR /&gt;# find /dir1 /dir2 /dir3 -type f | xargs cat &amp;gt;file&lt;BR /&gt;&lt;BR /&gt;As you didn't tell us where and how the order of the files is determined, I cannot answer that question (yet).&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.merijn&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Dec 2004 07:05:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452779#M209056</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-12-30T07:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: HELP needed with simple script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452780#M209057</link>
      <description>Hi&lt;BR /&gt;try this&lt;BR /&gt;&lt;BR /&gt;cd /&lt;BR /&gt; for i in *&lt;BR /&gt;do&lt;BR /&gt;if (-d $i)&lt;BR /&gt;cd $i&lt;BR /&gt; for x in *&lt;BR /&gt;cat $x &amp;gt;&amp;gt; file&lt;BR /&gt;done&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Dec 2004 07:07:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452780#M209057</guid>
      <dc:creator>Ravi_8</dc:creator>
      <dc:date>2004-12-30T07:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: HELP needed with simple script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452781#M209058</link>
      <description>I agree and that would work fine BUT i have to concate the files in a particular order i.e. dir_3, dir_1 dir_a etc</description>
      <pubDate>Thu, 30 Dec 2004 07:07:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452781#M209058</guid>
      <dc:creator>Declan Heerey</dc:creator>
      <dc:date>2004-12-30T07:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: HELP needed with simple script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452782#M209059</link>
      <description>Aghhh, i like the # find /dir1 /dir2 /dir3 -type f -exec cat {} &amp;gt;&amp;gt;file \; and this should work a treat. Don't know why i didn't think of it - Mind block brought on by Christmas festivities &lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 30 Dec 2004 07:11:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452782#M209059</guid>
      <dc:creator>Declan Heerey</dc:creator>
      <dc:date>2004-12-30T07:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: HELP needed with simple script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452783#M209060</link>
      <description>can you explain why the xargs is faster than the exec?</description>
      <pubDate>Thu, 30 Dec 2004 07:27:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452783#M209060</guid>
      <dc:creator>Declan Heerey</dc:creator>
      <dc:date>2004-12-30T07:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: HELP needed with simple script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452784#M209061</link>
      <description>-exec starts a 'cat' process for each file, xargs starts a single 'cat' process for all files.&lt;BR /&gt;&lt;BR /&gt;context switches are expensive on multiuser systems&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 30 Dec 2004 07:36:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-with-simple-script/m-p/3452784#M209061</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-12-30T07:36:39Z</dc:date>
    </item>
  </channel>
</rss>

