<?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 clock in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729903#M254355</link>
    <description>I want to add a clock in a script. the script is used for showing menu. I want that the time will be changed after 5 sec. how can i do that&lt;BR /&gt;&lt;BR /&gt;System Name : hpdev  Time :&lt;BR /&gt;&lt;BR /&gt;Choose one of the following option:&lt;BR /&gt;&lt;BR /&gt;[P] for Password Change&lt;BR /&gt;[U] for Unlock user&lt;BR /&gt;[E] for Exit&lt;BR /&gt;</description>
    <pubDate>Sun, 12 Feb 2006 21:15:01 GMT</pubDate>
    <dc:creator>Khashru</dc:creator>
    <dc:date>2006-02-12T21:15:01Z</dc:date>
    <item>
      <title>clock</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729903#M254355</link>
      <description>I want to add a clock in a script. the script is used for showing menu. I want that the time will be changed after 5 sec. how can i do that&lt;BR /&gt;&lt;BR /&gt;System Name : hpdev  Time :&lt;BR /&gt;&lt;BR /&gt;Choose one of the following option:&lt;BR /&gt;&lt;BR /&gt;[P] for Password Change&lt;BR /&gt;[U] for Unlock user&lt;BR /&gt;[E] for Exit&lt;BR /&gt;</description>
      <pubDate>Sun, 12 Feb 2006 21:15:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729903#M254355</guid>
      <dc:creator>Khashru</dc:creator>
      <dc:date>2006-02-12T21:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: clock</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729904#M254356</link>
      <description>Do you want to change the time after 5 sec eventhough the input is given for Choose or not?&lt;BR /&gt;&lt;BR /&gt;It is easy to change the time with clear command as like,&lt;BR /&gt;&lt;BR /&gt;while [[ 1 ]]&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;echo "System Name: `hostname` Time: `date`"&lt;BR /&gt;echo "Choose"&lt;BR /&gt;echo "[P] for Password Change&lt;BR /&gt;[U] for Unlock user&lt;BR /&gt;[E] for Exit"&lt;BR /&gt;read OPTION&lt;BR /&gt;&lt;BR /&gt;# Use some function to do operation.&lt;BR /&gt;here...()&lt;BR /&gt;clear&lt;BR /&gt;&lt;BR /&gt;sleep 5&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Mon, 13 Feb 2006 01:33:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729904#M254356</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-13T01:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: clock</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729905#M254357</link>
      <description>You can use this as a base for what you want. Mind that it will 'destroy' old traps you set !&lt;BR /&gt;&lt;BR /&gt;But it will print out the date every 5 seconds.&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;trap '/usr/bin/date' HUP&lt;BR /&gt;&lt;BR /&gt;( while true&lt;BR /&gt;do&lt;BR /&gt;kill -HUP $$&lt;BR /&gt;sleep 5&lt;BR /&gt;done&lt;BR /&gt;) &amp;amp;&lt;BR /&gt;&lt;BR /&gt;ss=$!&lt;BR /&gt;&lt;BR /&gt;trap '/usr/bin/kill $ss' INT&lt;BR /&gt;&lt;BR /&gt;read a&lt;BR /&gt;&lt;BR /&gt;kill $ss&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Feb 2006 02:53:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729905#M254357</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2006-02-13T02:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: clock</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729906#M254358</link>
      <description>If you want the script to respond to the menu commands and at the same time, update the time, the script will be quite tricky to implement. Essentially, you would wait for input for up to 5 seconds, then if nothing was typed, redisplay the header which includes the date. Be sure to use $(date) rather than the obsolete grave accents `date` as it is very easy to mistype the characters. The date command has many options to show just hour:min or add secs, etc. To timeout the read command, see the man page for line.</description>
      <pubDate>Mon, 13 Feb 2006 08:53:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clock/m-p/3729906#M254358</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-02-13T08:53:54Z</dc:date>
    </item>
  </channel>
</rss>

