<?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: PROBLEM WITH PROMPT AND HOUR in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553152#M225293</link>
    <description>Did  you try with /etc/profile file?? It will be execute for every user who is using terminal based login (not CDE).&lt;BR /&gt;&lt;BR /&gt;/etc/profile&lt;BR /&gt;PS1=`$(hostname)[(date +'%H:%M:%S')]:$PWD&amp;gt;'&lt;BR /&gt;export $PS1&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 27 May 2005 03:57:36 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-05-27T03:57:36Z</dc:date>
    <item>
      <title>PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553148#M225289</link>
      <description>I want to put the current hour on my unix prompt and I found the right script in order to do it. And I've added it in my .profile file.&lt;BR /&gt;&lt;BR /&gt;=====================================&lt;BR /&gt;typeset -RZ2 _x1 _x2 _x3&lt;BR /&gt;let SECONDS=$(date '+3600*%H+60*%M+%S')&lt;BR /&gt;_s='(_x1=(SECONDS/3600)%24)==(_x2=(SECONDS/60)%60)==(_x3=SECONDS%60)'&lt;BR /&gt;TIME='"${_d[_s]}$_x1:$_x2:$_x3"'&lt;BR /&gt;export PS1=`hostname`"[$TIME]:\$PWD&amp;gt; "&lt;BR /&gt;=====================================&lt;BR /&gt;&lt;BR /&gt;The problem was the following:&lt;BR /&gt;If I logging in with my personal user account it work and the prompt was displayed correctly.&lt;BR /&gt;If logging in with root account I wasn't able to have the right prompt.&lt;BR /&gt;EXAMPLES:&lt;BR /&gt;For my ACCOUNT&lt;BR /&gt;myhost[10:36:41]:/home/myuser&amp;gt;&lt;BR /&gt;For root ACCOUNT:&lt;BR /&gt;myhost["${_d[_s]}$_x1:$_x2:$_x3"]:$PWD&amp;gt;&lt;BR /&gt;&lt;BR /&gt;P.S.: Both the user are useing the same SHELL: /sbin/sh&lt;BR /&gt;&lt;BR /&gt;Thanks for any help.&lt;BR /&gt;</description>
      <pubDate>Fri, 27 May 2005 03:26:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553148#M225289</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2005-05-27T03:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553149#M225290</link>
      <description>Prompt settings are using PS1 variable. You can set PS1 setting in /etc/profile or $HOME/.profile file to read that value.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Fri, 27 May 2005 03:32:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553149#M225290</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-05-27T03:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553150#M225291</link>
      <description>Thanks for the reply but it didn't solve the problem I've already tried it.&lt;BR /&gt;</description>
      <pubDate>Fri, 27 May 2005 03:37:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553150#M225291</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2005-05-27T03:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553151#M225292</link>
      <description>Hi Bernardo,&lt;BR /&gt;&lt;BR /&gt;You must quote all like this:&lt;BR /&gt;&lt;BR /&gt;export PS1="`hostname`# ..." &lt;BR /&gt;&lt;BR /&gt;Or else, you are changing the hostname...&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes</description>
      <pubDate>Fri, 27 May 2005 03:57:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553151#M225292</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2005-05-27T03:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553152#M225293</link>
      <description>Did  you try with /etc/profile file?? It will be execute for every user who is using terminal based login (not CDE).&lt;BR /&gt;&lt;BR /&gt;/etc/profile&lt;BR /&gt;PS1=`$(hostname)[(date +'%H:%M:%S')]:$PWD&amp;gt;'&lt;BR /&gt;export $PS1&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 27 May 2005 03:57:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553152#M225293</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-05-27T03:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553153#M225294</link>
      <description>It is as,&lt;BR /&gt;&lt;BR /&gt;PS1='$(hostname)[(date +'%H:%M:%S')]:$PWD&amp;gt;'&lt;BR /&gt;&lt;BR /&gt;` came instead of '.</description>
      <pubDate>Fri, 27 May 2005 03:58:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553153#M225294</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-05-27T03:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553154#M225295</link>
      <description>Try:&lt;BR /&gt;&lt;BR /&gt;export PS1=`hostname`[`date +%H:%M:%S`]:\$PWD&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 27 May 2005 04:24:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553154#M225295</guid>
      <dc:creator>Suraj Singh_1</dc:creator>
      <dc:date>2005-05-27T04:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553155#M225296</link>
      <description>Did you get answer? IS it working?</description>
      <pubDate>Fri, 27 May 2005 04:31:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553155#M225296</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-05-27T04:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553156#M225297</link>
      <description>Thanks to all. But:&lt;BR /&gt;&lt;BR /&gt;For Eric:&lt;BR /&gt;I've quoted everything but it didn0t works.&lt;BR /&gt;&lt;BR /&gt;For Muthukumar:&lt;BR /&gt;I tried to put the script in the /etc/profile but it work for my user account and not for root account.&lt;BR /&gt;The prompt that you have suggested me didn't update the date every time that you execute a command and the prompt come back.&lt;BR /&gt;&lt;BR /&gt;My prompt should be like this:&lt;BR /&gt;myhost[10:10:10]/home/myuser&amp;gt; cd ..&lt;BR /&gt;myhost[10:10:14]/home&amp;gt;cd myuser&lt;BR /&gt;myhost[10:10:19]/home/myuser&amp;gt;&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;And not:&lt;BR /&gt;myhost[10:10:10]/home/myuser&amp;gt; cd ..&lt;BR /&gt;myhost[10:10:10]/home&amp;gt; cd myuser&lt;BR /&gt;myhost[10:10:10]/home/myuser&amp;gt;&lt;BR /&gt;&lt;BR /&gt;For suraj:&lt;BR /&gt;This is not an export problem I know that I've to export the PS1 varable.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Bernardo</description>
      <pubDate>Fri, 27 May 2005 04:45:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553156#M225297</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2005-05-27T04:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553157#M225298</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You only get "10:10:10" because PS1 in ONLY seted at login. There a function you may use for thids: the clock function (man clock)...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes</description>
      <pubDate>Fri, 27 May 2005 04:52:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553157#M225298</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2005-05-27T04:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553158#M225299</link>
      <description>PS1 varialble can show date, user, hostname and pwd. These details are static to that moment. Time will be variable.&lt;BR /&gt;&lt;BR /&gt;$PWD will be update when directory is navigated. So that it will be replicated in prompt.&lt;BR /&gt;&lt;BR /&gt;If you export it with date command, it will keep static data of time. I think there may be a change to have this in bash PS1.&lt;BR /&gt;&lt;BR /&gt;check this out,&lt;BR /&gt;&lt;A href="http://www.nersc.no/~knutal/unix_tips.html" target="_blank"&gt;http://www.nersc.no/~knutal/unix_tips.html&lt;/A&gt;</description>
      <pubDate>Fri, 27 May 2005 04:58:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553158#M225299</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-05-27T04:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553159#M225300</link>
      <description>Bernardo, try the following:&lt;BR /&gt;&lt;BR /&gt;set +u&lt;BR /&gt;&lt;BR /&gt;I don't know the internals of this shell flag.&lt;BR /&gt;&lt;BR /&gt;In my box:&lt;BR /&gt;&lt;BR /&gt;["${_d[_s]}$_x1:$_x2:$_x3"]&amp;gt; set +u&lt;BR /&gt;[14:03:47]&amp;gt;&lt;BR /&gt;&lt;BR /&gt;I remember there are 'set +u' and 'set -u' in the root's .profile.&lt;BR /&gt;</description>
      <pubDate>Fri, 27 May 2005 07:07:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553159#M225300</guid>
      <dc:creator>CAS_2</dc:creator>
      <dc:date>2005-05-27T07:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM WITH PROMPT AND HOUR</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553160#M225301</link>
      <description>Great CAS!!!&lt;BR /&gt;BINGO!!!&lt;BR /&gt;set +u works fine!&lt;BR /&gt;&lt;BR /&gt;Thanks to all.&lt;BR /&gt;Bernardo</description>
      <pubDate>Fri, 27 May 2005 07:17:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-prompt-and-hour/m-p/3553160#M225301</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2005-05-27T07:17:23Z</dc:date>
    </item>
  </channel>
</rss>

