<?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 to write a shell script in HPUX in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477628#M212867</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Jannik : Sorry for the points not assigned; i use to forget to assign, but not in my lasts threads. &lt;BR /&gt;&lt;BR /&gt;The names are in the form:&lt;BR /&gt;&lt;BR /&gt;- filexxx-&lt;DATE&gt;-.Z&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/DATE&gt;</description>
    <pubDate>Thu, 03 Feb 2005 09:36:03 GMT</pubDate>
    <dc:creator>R.O.</dc:creator>
    <dc:date>2005-02-03T09:36:03Z</dc:date>
    <item>
      <title>Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477623#M212862</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to write a program in shell script that does the following:&lt;BR /&gt;&lt;BR /&gt;- check if three files (with its date of creation in its name) of today, yesterday and three days ago, exists&lt;BR /&gt;- If they exists, remove all the other files older than three days ago. If they do not &lt;BR /&gt;exists, do nothing.&lt;BR /&gt;&lt;BR /&gt;I don</description>
      <pubDate>Thu, 03 Feb 2005 08:41:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477623#M212862</guid>
      <dc:creator>R.O.</dc:creator>
      <dc:date>2005-02-03T08:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477624#M212863</link>
      <description>I donÂ´t know so much about shell script, so any help will be appreciated .&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;(the messages was cu</description>
      <pubDate>Thu, 03 Feb 2005 08:42:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477624#M212863</guid>
      <dc:creator>R.O.</dc:creator>
      <dc:date>2005-02-03T08:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477625#M212864</link>
      <description>I donÂ´t know so much about shell script, so any help will be appreciated .&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;(the messages was cu</description>
      <pubDate>Thu, 03 Feb 2005 08:42:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477625#M212864</guid>
      <dc:creator>R.O.</dc:creator>
      <dc:date>2005-02-03T08:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477626#M212865</link>
      <description>If you assign points to all you old questions we might just help you!&lt;BR /&gt;&lt;BR /&gt;company name:     &lt;BR /&gt;country: spain &lt;BR /&gt;personal quote:  &lt;BR /&gt;certification:  &lt;BR /&gt;ITRC member since: April 21, 2003  &lt;BR /&gt;last contribution date: February 03, 2005  &lt;BR /&gt;I have assigned points to   46  of   134  responses to my questions.  &lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2005 09:19:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477626#M212865</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2005-02-03T09:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477627#M212866</link>
      <description>hi, &lt;BR /&gt; &lt;BR /&gt;can you give examples of this filenames.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;Thierry.</description>
      <pubDate>Thu, 03 Feb 2005 09:26:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477627#M212866</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2005-02-03T09:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477628#M212867</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Jannik : Sorry for the points not assigned; i use to forget to assign, but not in my lasts threads. &lt;BR /&gt;&lt;BR /&gt;The names are in the form:&lt;BR /&gt;&lt;BR /&gt;- filexxx-&lt;DATE&gt;-.Z&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/DATE&gt;</description>
      <pubDate>Thu, 03 Feb 2005 09:36:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477628#M212867</guid>
      <dc:creator>R.O.</dc:creator>
      <dc:date>2005-02-03T09:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477629#M212868</link>
      <description>Hi,&lt;BR /&gt;if the file names are in the format *YYYYMMDD*&lt;BR /&gt;then somthing like this will get you started.&lt;BR /&gt;&lt;BR /&gt;Some of the guys here have prewritten scripts that do this sort of thing. Use the keyword 'yesterday'in the forum search.&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 03 Feb 2005 09:45:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477629#M212868</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-02-03T09:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477630#M212869</link>
      <description>hi,&lt;BR /&gt; &lt;BR /&gt;as you still didn't give real examples, how about something general:&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;nofiles=`find /yourdir -type f -name "file*.Z" -mtime -4 | wc -l`&lt;BR /&gt;if [ $nofiles -ge 4 ]&lt;BR /&gt;then&lt;BR /&gt;  find /yourdir -type f -name "file*.Z" -mtime +4 -exec rm {} \; &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;notes:&lt;BR /&gt;- adapt "name" and "-mtime" to your needs&lt;BR /&gt;- test this first without the "-exec rm {} \;"&lt;BR /&gt;- find will also work through subdirs, so don't use this if you have subdirs.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;Thierry.</description>
      <pubDate>Thu, 03 Feb 2005 10:11:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477630#M212869</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2005-02-03T10:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477631#M212870</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The exactly names of the files are:&lt;BR /&gt;&lt;BR /&gt; backup_01-02-05_00_00.dmp.Z , where "01-02-05_00_00" is "day-month-year_hour_minute"&lt;BR /&gt;&lt;BR /&gt;I have already a script with "mtime" but I think it is a bit "dangerous". The script that have sent Peter, works fine to calculate the date; I only need to convert to this date and to remove he older...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;R.O.</description>
      <pubDate>Thu, 03 Feb 2005 11:19:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477631#M212870</guid>
      <dc:creator>R.O.</dc:creator>
      <dc:date>2005-02-03T11:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477632#M212871</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Peter, how can I convert four digits of year in two? (tried printf("%02d... but it does not work)&lt;BR /&gt;&lt;BR /&gt;In the other hand, how can I select the files older than the three firsts to delete them??&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Fri, 04 Feb 2005 05:05:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477632#M212871</guid>
      <dc:creator>R.O.</dc:creator>
      <dc:date>2005-02-04T05:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477633#M212872</link>
      <description>hi,&lt;BR /&gt; &lt;BR /&gt;1. something like:&lt;BR /&gt;two = `echo $four | cut -c3-4`&lt;BR /&gt; &lt;BR /&gt;2. &lt;BR /&gt;find /yourdir ! -newer file3daysago ! -name file3daysago&lt;BR /&gt; &lt;BR /&gt;or specify all 3 files:&lt;BR /&gt;find /yourdir ! -newer file1 ! -name file1 ! -newer file2 ! -name file2 ! -newer file3 ! -name file3&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;Thierry.&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Feb 2005 05:33:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477633#M212872</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2005-02-04T05:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477634#M212873</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I want to avoid to select files based upon in its modification time, but in the date inserted in its name. It is possible that someone modifies a file, so the modification time is not valid to do this.&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Fri, 04 Feb 2005 05:52:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477634#M212873</guid>
      <dc:creator>R.O.</dc:creator>
      <dc:date>2005-02-04T05:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help to write a shell script in HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477635#M212874</link>
      <description>R.O.,&lt;BR /&gt;to answer your question re 4/2 digits:&lt;BR /&gt;&lt;BR /&gt;firstdate=`perl -e '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time-2*86400); $fix_year = $year - 100; $fix_m&lt;BR /&gt;on = $mon + 1;printf("%02d%02d%02d\n",$fix_year,$fix_mon,$mday)'`&lt;BR /&gt;&lt;BR /&gt;The difference is rather than adding 1900 you subtract 100 as year is number of years since 1900. The format can then be changed from %04 to %02. Problems MAY occurs with date before 1/1/2000, but this should not be problem for what you want to do.&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 04 Feb 2005 06:04:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-write-a-shell-script-in-hpux/m-p/3477635#M212874</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-02-04T06:04:30Z</dc:date>
    </item>
  </channel>
</rss>

