<?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: Scripting help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628579#M920428</link>
    <description>Harry - How would I go about removing the files that were found by the find command?  I can't do a rm abc*.  I only want to remove files that were found w/ the find command.&lt;BR /&gt;&lt;BR /&gt;Santosh - I tried your script but get the following error:&lt;BR /&gt;&lt;BR /&gt;/tmp # for FILENAME in (find . -name abc\*)&lt;BR /&gt;sh: Syntax error: `(' is not expected.</description>
    <pubDate>Mon, 10 Dec 2001 15:06:15 GMT</pubDate>
    <dc:creator>Duke Nguyen</dc:creator>
    <dc:date>2001-12-10T15:06:15Z</dc:date>
    <item>
      <title>Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628572#M920421</link>
      <description>Need some help/ideas with writing a script that will do the following:&lt;BR /&gt;1. Scripts will need to scan a directory and find files begining w/ abc*&lt;BR /&gt;2. Then append all abc* files that were found to a new file named xyz.dat&lt;BR /&gt;3. After running another script to process xyz.dat file, will then need to delete only the abc* files that were found and the xyz.dat file.&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 10 Dec 2001 14:14:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628572#M920421</guid>
      <dc:creator>Duke Nguyen</dc:creator>
      <dc:date>2001-12-10T14:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628573#M920422</link>
      <description>How about&lt;BR /&gt;&lt;BR /&gt;cat abc* &amp;gt;xyz.txt&lt;BR /&gt;sh yourscript&lt;BR /&gt;rm abc* xyz.txt&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 10 Dec 2001 14:21:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628573#M920422</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2001-12-10T14:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628574#M920423</link>
      <description>Duke,&lt;BR /&gt;&lt;BR /&gt;cd to appropriate directory then&lt;BR /&gt;&lt;BR /&gt;'find . -type f -name "abc*" &amp;gt;&amp;gt; xyz.dat'&lt;BR /&gt;&lt;BR /&gt;As to question (3), what kind of processing would be done on xyz.dat?&lt;BR /&gt;&lt;BR /&gt;To delete the files that are listed in xyz.dat, you can do this:&lt;BR /&gt;&lt;BR /&gt;cat xyz.dat | xargs -i rm {}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Dec 2001 14:22:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628574#M920423</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-12-10T14:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628575#M920424</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How about:&lt;BR /&gt;&lt;BR /&gt;===============================&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;dir=$1&lt;BR /&gt;cd $dir&lt;BR /&gt;find . -name "abc*" &amp;gt; xyz.dat&lt;BR /&gt;...&lt;BR /&gt;... process xyz.dat&lt;BR /&gt;...&lt;BR /&gt;cd $dir&lt;BR /&gt;cat xyz.dat | xargs rm&lt;BR /&gt;rm xyz.dat&lt;BR /&gt;==============================&lt;BR /&gt;&lt;BR /&gt;then run with:&lt;BR /&gt;&lt;BR /&gt;yourscript.sh directory-to-process&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Mon, 10 Dec 2001 14:23:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628575#M920424</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-12-10T14:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628576#M920425</link>
      <description>Are you trying to append the contents of the abc* files to xyz.dat?  If so, how about:&lt;BR /&gt;&lt;BR /&gt;for FILENAME in (find . -name abc\*)&lt;BR /&gt;do&lt;BR /&gt;  cat $FILENAME &amp;gt;&amp;gt;xyz.dat&lt;BR /&gt;  FILES="$FILES $FILENAME"&lt;BR /&gt;done&lt;BR /&gt;... process xyz.dat&lt;BR /&gt;&lt;BR /&gt;rm $FILES&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Mon, 10 Dec 2001 14:27:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628576#M920425</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-12-10T14:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628577#M920426</link>
      <description>Thanks for the quick responses.&lt;BR /&gt;I should have been more clear, but yes...I need to append the contents of the abc* files to xyz.dat.  File xyz.dat is data that will be processed by a sql script.</description>
      <pubDate>Mon, 10 Dec 2001 14:51:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628577#M920426</guid>
      <dc:creator>Duke Nguyen</dc:creator>
      <dc:date>2001-12-10T14:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628578#M920427</link>
      <description>AHHHH, the "contents" of the abc* files:&lt;BR /&gt;&lt;BR /&gt;'find . -type f -name "abc*" | xargs -i cat {} &amp;gt;&amp;gt; xyz.dat' &lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 10 Dec 2001 14:55:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628578#M920427</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-12-10T14:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628579#M920428</link>
      <description>Harry - How would I go about removing the files that were found by the find command?  I can't do a rm abc*.  I only want to remove files that were found w/ the find command.&lt;BR /&gt;&lt;BR /&gt;Santosh - I tried your script but get the following error:&lt;BR /&gt;&lt;BR /&gt;/tmp # for FILENAME in (find . -name abc\*)&lt;BR /&gt;sh: Syntax error: `(' is not expected.</description>
      <pubDate>Mon, 10 Dec 2001 15:06:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628579#M920428</guid>
      <dc:creator>Duke Nguyen</dc:creator>
      <dc:date>2001-12-10T15:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628580#M920429</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;In that case, how about: &lt;BR /&gt;&lt;BR /&gt;=============================== &lt;BR /&gt;#!/bin/ksh &lt;BR /&gt;&lt;BR /&gt;dir=$1 &lt;BR /&gt;cd $dir &lt;BR /&gt;find . -name "abc*" &amp;gt; abc.dat&lt;BR /&gt;cat abc.dat | xargs cat &amp;gt;&amp;gt; xyz.dat&lt;BR /&gt;... &lt;BR /&gt;... process xyz.dat &lt;BR /&gt;... &lt;BR /&gt;cd $dir &lt;BR /&gt;cat abc.dat | xargs rm &lt;BR /&gt;rm xyz.dat &lt;BR /&gt;============================== &lt;BR /&gt;&lt;BR /&gt;then run with: &lt;BR /&gt;&lt;BR /&gt;yourscript.sh directory-to-process &lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Mon, 10 Dec 2001 15:38:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628580#M920429</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-12-10T15:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628581#M920430</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;find . -name abc\* -exec echo {} &amp;gt;&amp;gt;list_abc \;&lt;BR /&gt;find . -name abc\* -exec cat {} &amp;gt;&amp;gt;xyz.dat \;&lt;BR /&gt;&lt;BR /&gt;execute the script&lt;BR /&gt;&lt;BR /&gt;rm `cat list_abc` list_abc xyz.dat&lt;BR /&gt;&lt;BR /&gt;Can be improved by making just one find, but since I am not a scripting wizard, like Clay for example, I couldn't make it in 5 minutes.&lt;BR /&gt;&lt;BR /&gt;If it would be possible to make something like:&lt;BR /&gt;&lt;BR /&gt;find . -name abc\* -exec echo {} &amp;gt;&amp;gt;list_abc &amp;amp;&amp;amp; cat {} &amp;gt;&amp;gt;xyz.dat \;&lt;BR /&gt;&lt;BR /&gt;it would be shorter. But it works with two 'find's anyway.&lt;BR /&gt;&lt;BR /&gt;E.</description>
      <pubDate>Mon, 10 Dec 2001 15:40:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628581#M920430</guid>
      <dc:creator>Eugen Cocalea</dc:creator>
      <dc:date>2001-12-10T15:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628582#M920431</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Got it!&lt;BR /&gt;&lt;BR /&gt;find . -name abc\* -fprint list_abc -exec cat {} &amp;gt;&amp;gt;xyz.dat \;&lt;BR /&gt;&lt;BR /&gt;execute script&lt;BR /&gt;&lt;BR /&gt;rm `cat list_abc` list_abc xyz.dat&lt;BR /&gt;&lt;BR /&gt;E.</description>
      <pubDate>Mon, 10 Dec 2001 15:48:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628582#M920431</guid>
      <dc:creator>Eugen Cocalea</dc:creator>
      <dc:date>2001-12-10T15:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628583#M920432</link>
      <description>Thanks for all your help!</description>
      <pubDate>Mon, 10 Dec 2001 17:40:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/2628583#M920432</guid>
      <dc:creator>Duke Nguyen</dc:creator>
      <dc:date>2001-12-10T17:40:25Z</dc:date>
    </item>
  </channel>
</rss>

