<?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 writing a small script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192975#M165089</link>
    <description>Hi &lt;BR /&gt;&lt;BR /&gt;i m sorry , but i dont have a lot of knowlege with shelling , &lt;BR /&gt;&lt;BR /&gt;i want to write a script that will do this : &lt;BR /&gt;&lt;BR /&gt;1. check in i have in / a core file &lt;BR /&gt;2. run the command file and what on the core file and report this info to a file . &lt;BR /&gt;&lt;BR /&gt;i will run it on crontab so i dont need to run it with a loop . &lt;BR /&gt;&lt;BR /&gt;thanks</description>
    <pubDate>Mon, 16 Feb 2004 09:05:12 GMT</pubDate>
    <dc:creator>Berson Mark</dc:creator>
    <dc:date>2004-02-16T09:05:12Z</dc:date>
    <item>
      <title>writing a small script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192975#M165089</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;i m sorry , but i dont have a lot of knowlege with shelling , &lt;BR /&gt;&lt;BR /&gt;i want to write a script that will do this : &lt;BR /&gt;&lt;BR /&gt;1. check in i have in / a core file &lt;BR /&gt;2. run the command file and what on the core file and report this info to a file . &lt;BR /&gt;&lt;BR /&gt;i will run it on crontab so i dont need to run it with a loop . &lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Mon, 16 Feb 2004 09:05:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192975#M165089</guid>
      <dc:creator>Berson Mark</dc:creator>
      <dc:date>2004-02-16T09:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: writing a small script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192976#M165090</link>
      <description>I haven't been able to try this one but,&lt;BR /&gt;&lt;BR /&gt;00 02 * * * /usr/bin/find /  -type f -name "core" -exec file &amp;gt; /home/root/core_report {} \;&lt;BR /&gt;&lt;BR /&gt;should probably be close to what you're looking for.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 16 Feb 2004 09:13:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192976#M165090</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-02-16T09:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: writing a small script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192977#M165091</link>
      <description>1) write a script :&lt;BR /&gt;e.g. name=/usr/local/bin/chk&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;what $1 &amp;gt;/tmp/$1.what&lt;BR /&gt;file $1 &amp;gt;/tmp/$1.file&lt;BR /&gt;&lt;BR /&gt;2) run the command&lt;BR /&gt;find / -name core -exec /usr/local/bin/chk {} \;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Mon, 16 Feb 2004 09:14:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192977#M165091</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2004-02-16T09:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: writing a small script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192978#M165092</link>
      <description>Sorry, I should have mentioned that that was intended to be a crontab entry running at 2:00 AM everyday.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 16 Feb 2004 09:15:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192978#M165092</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-02-16T09:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: writing a small script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192979#M165093</link>
      <description>find . -name core -exec file {} \; -exec what {} \; &amp;gt;&amp;gt; outputfile&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Feb 2004 09:17:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192979#M165093</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-02-16T09:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: writing a small script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192980#M165094</link>
      <description>If you only want to search in /, and not in other fielsystems, add a '-xdev' to your find statement.&lt;BR /&gt;&lt;BR /&gt;find / -xdev -name core -type -exec file {} &amp;gt;&amp;gt; yourlogfile \;&lt;BR /&gt;&lt;BR /&gt;This will only search the root filesystem, find regular (normal) files, and executes the 'file' command, and APPEND the output to yourlogfile.&lt;BR /&gt;&lt;BR /&gt;Since you may want to execute several commands on 1 core-file, I think you should follow Jean-Luc's solution by writing a separate script to do this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I would prefer something like:&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;(&lt;BR /&gt;echo $1&lt;BR /&gt;what $1&lt;BR /&gt;file $1 &lt;BR /&gt;) &amp;gt;&amp;gt; /root/yourlogfile&lt;BR /&gt;&lt;BR /&gt;Or even put the date in the logfilename.&lt;BR /&gt;(something like: yourlogfile=/root/logfile`date "+...."`&lt;BR /&gt;and change the last line to:&lt;BR /&gt;) &amp;gt;&amp;gt; $yourlogfile&lt;BR /&gt;&lt;BR /&gt;JP.</description>
      <pubDate>Mon, 16 Feb 2004 10:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/writing-a-small-script/m-p/3192980#M165094</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2004-02-16T10:08:44Z</dc:date>
    </item>
  </channel>
</rss>

