<?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: Posix shell : login name in prompt in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836740#M90352</link>
    <description>T.G., i can't find /usr/xpg4/bin/id&lt;BR /&gt;i'm on HP-UX 11.0&lt;BR /&gt;but it doesn't matter : your solution seems not to work.&lt;BR /&gt;&lt;BR /&gt;To reflect login name in PS1, i think it can't be done in .profile because .profile ISN'T reread after su. Only the script mentioned with $ENV is reread, but su/HP-UX unset it !!!&lt;BR /&gt;&lt;BR /&gt;Any idea ?&lt;BR /&gt;&lt;BR /&gt;Cyril.</description>
    <pubDate>Thu, 31 Oct 2002 13:51:44 GMT</pubDate>
    <dc:creator>BORTZMEYER</dc:creator>
    <dc:date>2002-10-31T13:51:44Z</dc:date>
    <item>
      <title>Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836734#M90346</link>
      <description>Hi !&lt;BR /&gt;I wants 2 display my login name in the Posix shell prompt :&lt;BR /&gt;&lt;BR /&gt;jack$ id -un&lt;BR /&gt;jack&lt;BR /&gt;jack$ su joe&lt;BR /&gt;joe$ exit&lt;BR /&gt;jack$&lt;BR /&gt;&lt;BR /&gt;With Solaris, AIX, Dynix/ptx, Linux (with korn shell, bash has \u), it can b done with :&lt;BR /&gt;&lt;BR /&gt;export ENV=$HOME/.shrc&lt;BR /&gt;&lt;BR /&gt;in $HOME/.shrc :&lt;BR /&gt;export PS1=`id -un`"$ "&lt;BR /&gt;&lt;BR /&gt;With HP-UX, as mentioned in su(1), the ENV environment variable is removed. So it can't work !&lt;BR /&gt;&lt;BR /&gt;Any workaround ?&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Oct 2002 11:34:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836734#M90346</guid>
      <dc:creator>BORTZMEYER</dc:creator>
      <dc:date>2002-10-31T11:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836735#M90347</link>
      <description>Hi&lt;BR /&gt;Try this in your ~/.profile&lt;BR /&gt;export PS1="[$(whoami)] $(hostname):\$PWD\&amp;gt; "                                                                      &lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Oct 2002 11:43:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836735#M90347</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2002-10-31T11:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836736#M90348</link>
      <description>Try this in your .profile&lt;BR /&gt;&lt;BR /&gt;PS1=`hostname`"@"`logname`"#"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 31 Oct 2002 11:48:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836736#M90348</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2002-10-31T11:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836737#M90349</link>
      <description>&lt;BR /&gt;Why not&lt;BR /&gt;&lt;BR /&gt;whoami&lt;BR /&gt;&lt;BR /&gt;??&lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;&lt;BR /&gt;echo $LOGNAME&lt;BR /&gt;&lt;BR /&gt;?? which works with hpux, aix, and solaris. &lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 31 Oct 2002 11:54:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836737#M90349</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-10-31T11:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836738#M90350</link>
      <description>1. See my example : i want PS1 changes after su.&lt;BR /&gt;Your solutions don't work.&lt;BR /&gt;2. whoami is equivalent 2 id -un but doesn't exist on Dynix/ptx.&lt;BR /&gt;3. With Solaris, AIX, etc., su does'nt unset $ENV, so $HOME/.shrc is source and PS1 is assigned properly (i.d. id -un is executed)</description>
      <pubDate>Thu, 31 Oct 2002 13:18:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836738#M90350</guid>
      <dc:creator>BORTZMEYER</dc:creator>
      <dc:date>2002-10-31T13:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836739#M90351</link>
      <description>How about using this &lt;BR /&gt;&lt;BR /&gt; PS1=`/usr/xpg4/bin/id -un`"$" &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 31 Oct 2002 13:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836739#M90351</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2002-10-31T13:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836740#M90352</link>
      <description>T.G., i can't find /usr/xpg4/bin/id&lt;BR /&gt;i'm on HP-UX 11.0&lt;BR /&gt;but it doesn't matter : your solution seems not to work.&lt;BR /&gt;&lt;BR /&gt;To reflect login name in PS1, i think it can't be done in .profile because .profile ISN'T reread after su. Only the script mentioned with $ENV is reread, but su/HP-UX unset it !!!&lt;BR /&gt;&lt;BR /&gt;Any idea ?&lt;BR /&gt;&lt;BR /&gt;Cyril.</description>
      <pubDate>Thu, 31 Oct 2002 13:51:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836740#M90352</guid>
      <dc:creator>BORTZMEYER</dc:creator>
      <dc:date>2002-10-31T13:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836741#M90353</link>
      <description>Hi&lt;BR /&gt;it is right that "su &lt;USERNAME&gt;" doesn't read .profile but "su - &lt;USERNAME&gt;" does.&lt;BR /&gt;&lt;BR /&gt;You can write this lines in /etc/profile than every user has the new prompt (even after a "su &lt;USERNAME&gt;" )&lt;BR /&gt;&lt;BR /&gt;Chris&lt;/USERNAME&gt;&lt;/USERNAME&gt;&lt;/USERNAME&gt;</description>
      <pubDate>Thu, 31 Oct 2002 14:29:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836741#M90353</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2002-10-31T14:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Posix shell : login name in prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836742#M90354</link>
      <description>Chris,&lt;BR /&gt;/etc/profile isn't read after su just "su -"&lt;BR /&gt;i want my prompt changes everytime i do a su (not only a "su -") like in my example.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Oct 2002 15:04:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/posix-shell-login-name-in-prompt/m-p/2836742#M90354</guid>
      <dc:creator>BORTZMEYER</dc:creator>
      <dc:date>2002-10-31T15:04:50Z</dc:date>
    </item>
  </channel>
</rss>

