<?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: Need help in creating shell script in HP-UX in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136578#M496409</link>
    <description>&lt;!-- !*# --&gt;&lt;P&gt;&amp;gt;Every hour search for specific files name formats in specified directories:&lt;BR /&gt;&lt;BR /&gt;If you don't care about the first time for the "hour back" limitation you can do:&lt;BR /&gt;DIR=/test/dir1&lt;BR /&gt;RF=ref_file&lt;BR /&gt;if [ ! -f ${RF}2 ]; then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; touch ${RF}2&lt;BR /&gt;fi&lt;BR /&gt;mv ${RF}2 ${RF}1&lt;BR /&gt;touch ${RF}2 # for next time&lt;BR /&gt;&lt;BR /&gt;find $DIR/dir2 \( -name "l50*.txt.*" -o -name "S0**.txt.*" \) ! -newer ${RF}1 &amp;gt; notify_file&lt;BR /&gt;find $DIR/dir3 \( -name "l50*.txt.*" -o -name "S0**.txt.*" \) ! -newer ${RF}1 |&lt;BR /&gt;grep -v l503a.txt &amp;gt;&amp;gt; notify_file&lt;BR /&gt;&lt;BR /&gt;if [ -s notify_file ]; then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailx -s "found files" abc@test.com &amp;lt; notify_file&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&amp;gt;And if the file exists with creation time&lt;BR /&gt;&lt;BR /&gt;You can only find modification times.&lt;/P&gt;</description>
    <pubDate>Sun, 12 Jan 2014 19:07:33 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2014-01-12T19:07:33Z</dc:date>
    <item>
      <title>Need help in creating shell script in hp-ux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136573#M496404</link>
      <description>Greetings to everyone, I would be greatful if someone could help me out for creating the shell script which would be applied on 11.23 HP-Ux OS.&lt;BR /&gt;&lt;BR /&gt;Every hour search for specific files name formats in specified directories:&lt;BR /&gt;&lt;BR /&gt;/test/dir1/dir2      search for l50*.txt.*&lt;BR /&gt;/test/dir1/dir3      search for l50*.txt.*&lt;BR /&gt;&lt;BR /&gt;/test/dir1/dir2    search for S0**.txt.*&lt;BR /&gt;/test/dir1/dir3      search for S0**.txt.*&lt;BR /&gt;&lt;BR /&gt;Exception l503a.txt on the /test/dir1/dir3.&lt;BR /&gt;&lt;BR /&gt;And if the file exists with creation time more than an hour back from the time when scan starts an email alert should be fired to abc@test.com with information on concerned file names.&lt;BR /&gt;&lt;BR /&gt;Please note: No alter should be fired for file I503a.txt in dir /test/dir1/dir3&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help and support.&lt;BR /&gt;&lt;BR /&gt;Nag.</description>
      <pubDate>Mon, 28 Jan 2008 14:07:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136573#M496404</guid>
      <dc:creator>Nagaraj Kris</dc:creator>
      <dc:date>2008-01-28T14:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in creating shell script in hp-ux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136574#M496405</link>
      <description>Do a man on find.  Pay particular attention to the -newer option.  Now do a man on touch so you can figure out how to create a reference file for find's -newer option.  Lastly, do a man on cron.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 28 Jan 2008 14:21:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136574#M496405</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2008-01-28T14:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in creating shell script in hp-ux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136575#M496406</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;I'll provide the guts of your answer, just as I did to a nearly identical question by you earlier this month:&lt;BR /&gt;&lt;BR /&gt;If you are looking for files modifed in the last hour, use Perl:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le 'find(sub{print if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt; (1/24) &amp;amp;&amp;amp; m/(l50|S0).*\.txt/},"/test")'&lt;BR /&gt;&lt;BR /&gt;This finds files in the specified directory that are 1/24 of a day (one hour) or less in age. This age is the *modification* age of the file. There is no such thing as a "creation" timestamp in Unix.&lt;BR /&gt;&lt;BR /&gt;If you would like to use pure shell:&lt;BR /&gt;&lt;BR /&gt;# touch -amt 01101530 /tmp/myref&lt;BR /&gt;# find /home/myref -type f -newer /tmp/myref -name "abc*"&lt;BR /&gt;&lt;BR /&gt;Of course, the "problem" in the shell solution is that you have to perform a touch of a reference file to create the one-hour delta everytime you want to search! The Perl solution obviates that.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 28 Jan 2008 14:31:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136575#M496406</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-28T14:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in creating shell script in hp-ux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136576#M496407</link>
      <description>Hello Sir, &lt;BR /&gt;&lt;BR /&gt;Thanks a lot for your inputs, I appreciate your speedy reply, i would try this out on the test server, and would update you about the same &lt;BR /&gt;&lt;BR /&gt;thanks &lt;BR /&gt;&lt;BR /&gt;Nag</description>
      <pubDate>Mon, 28 Jan 2008 15:03:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136576#M496407</guid>
      <dc:creator>Nagaraj Kris</dc:creator>
      <dc:date>2008-01-28T15:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in creating shell script in HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136578#M496409</link>
      <description>&lt;!-- !*# --&gt;&lt;P&gt;&amp;gt;Every hour search for specific files name formats in specified directories:&lt;BR /&gt;&lt;BR /&gt;If you don't care about the first time for the "hour back" limitation you can do:&lt;BR /&gt;DIR=/test/dir1&lt;BR /&gt;RF=ref_file&lt;BR /&gt;if [ ! -f ${RF}2 ]; then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; touch ${RF}2&lt;BR /&gt;fi&lt;BR /&gt;mv ${RF}2 ${RF}1&lt;BR /&gt;touch ${RF}2 # for next time&lt;BR /&gt;&lt;BR /&gt;find $DIR/dir2 \( -name "l50*.txt.*" -o -name "S0**.txt.*" \) ! -newer ${RF}1 &amp;gt; notify_file&lt;BR /&gt;find $DIR/dir3 \( -name "l50*.txt.*" -o -name "S0**.txt.*" \) ! -newer ${RF}1 |&lt;BR /&gt;grep -v l503a.txt &amp;gt;&amp;gt; notify_file&lt;BR /&gt;&lt;BR /&gt;if [ -s notify_file ]; then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailx -s "found files" abc@test.com &amp;lt; notify_file&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&amp;gt;And if the file exists with creation time&lt;BR /&gt;&lt;BR /&gt;You can only find modification times.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2014 19:07:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/4136578#M496409</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-01-12T19:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in creating shell script in hp-ux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/6331697#M496410</link>
      <description>&lt;P&gt;Hi i am an SAP basis consultant&lt;/P&gt;&lt;P&gt;i require an script to run in my system to take the files within the test folder and send it to my mail&lt;/P&gt;&lt;P&gt;the same issue as yours but for me age limit is okay&lt;/P&gt;&lt;P&gt;it would be better every hour i get an mail intimation of the files within the specified folder&lt;/P&gt;&lt;P&gt;kidnly help me out with an script that helps to ful fil my needs&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2014 09:15:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/6331697#M496410</guid>
      <dc:creator>GZWJ63</dc:creator>
      <dc:date>2014-01-12T09:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in creating shell script in HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/6331859#M496411</link>
      <description>&lt;P&gt;&amp;gt;to take the files within the test folder and send it to my mail&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure why you can't figure this out from the various posts.&amp;nbsp; They show how to use find and a reference file.&lt;/P&gt;&lt;P&gt;And how to mail the results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;every hour I get an mail intimation of the files within the specified folder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should set this up in crontab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2014 19:12:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-creating-shell-script-in-hp-ux/m-p/6331859#M496411</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-01-12T19:12:01Z</dc:date>
    </item>
  </channel>
</rss>

