<?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 SU loosing $HOME parameter in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344212#M191330</link>
    <description>Hi!&lt;BR /&gt;Does anybody know if is it possible to retain the $HOME variable even after a su (or su -) command?&lt;BR /&gt;&lt;BR /&gt;I mean: &lt;BR /&gt;&lt;BR /&gt;1) I'm using the user "alpha" with home: /home/alpha&lt;BR /&gt;2) alpha makes "su beta"&lt;BR /&gt;3) I'd like that $HOME is still /home/alpha.&lt;BR /&gt;&lt;BR /&gt;Same thing with $LOGNAME...can I have the same $LOGNAME even after a su or a su - ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;PS Actually I make aplha write a file with his $HOME and Beta read this file overwriting his $HOME with the variabile in the file! ;-)&lt;BR /&gt;</description>
    <pubDate>Thu, 29 Jul 2004 03:01:22 GMT</pubDate>
    <dc:creator>massimo_38</dc:creator>
    <dc:date>2004-07-29T03:01:22Z</dc:date>
    <item>
      <title>SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344212#M191330</link>
      <description>Hi!&lt;BR /&gt;Does anybody know if is it possible to retain the $HOME variable even after a su (or su -) command?&lt;BR /&gt;&lt;BR /&gt;I mean: &lt;BR /&gt;&lt;BR /&gt;1) I'm using the user "alpha" with home: /home/alpha&lt;BR /&gt;2) alpha makes "su beta"&lt;BR /&gt;3) I'd like that $HOME is still /home/alpha.&lt;BR /&gt;&lt;BR /&gt;Same thing with $LOGNAME...can I have the same $LOGNAME even after a su or a su - ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;PS Actually I make aplha write a file with his $HOME and Beta read this file overwriting his $HOME with the variabile in the file! ;-)&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jul 2004 03:01:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344212#M191330</guid>
      <dc:creator>massimo_38</dc:creator>
      <dc:date>2004-07-29T03:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344213#M191331</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;To keep your current environment use:&lt;BR /&gt;#su &lt;OTHER_USER&gt;&lt;BR /&gt;&lt;BR /&gt;To set &lt;OTHER_USER&gt; environment use:&lt;BR /&gt;#su - &lt;OTHER_USER&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds.&lt;/OTHER_USER&gt;&lt;/OTHER_USER&gt;&lt;/OTHER_USER&gt;</description>
      <pubDate>Thu, 29 Jul 2004 03:04:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344213#M191331</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2004-07-29T03:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344214#M191332</link>
      <description>Using:&lt;BR /&gt;&lt;BR /&gt;$ su &lt;USER&gt; (will keep the same environment, but not retriev the env of the new user)&lt;BR /&gt;&lt;BR /&gt;$ su - &lt;USER&gt; (will pick up env of the new user)&lt;/USER&gt;&lt;/USER&gt;</description>
      <pubDate>Thu, 29 Jul 2004 03:13:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344214#M191332</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2004-07-29T03:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344215#M191333</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I think that you make mistake typing&lt;BR /&gt;su beta&lt;BR /&gt;instead &lt;BR /&gt;su - beta&lt;BR /&gt;Try with last one it will solve your problem.&lt;BR /&gt;Regards,&lt;BR /&gt;Borislav</description>
      <pubDate>Thu, 29 Jul 2004 03:14:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344215#M191333</guid>
      <dc:creator>Borislav Perkov</dc:creator>
      <dc:date>2004-07-29T03:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344216#M191334</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Always you can force any environmental variables, i.e:&lt;BR /&gt;&lt;BR /&gt;#whoami&lt;BR /&gt;user1&lt;BR /&gt;#echo $HOME&lt;BR /&gt;/home/user1&lt;BR /&gt;#su - user2&lt;BR /&gt;#whoami&lt;BR /&gt;user2&lt;BR /&gt;#echo $HOME&lt;BR /&gt;/home/user2&lt;BR /&gt;#export HOME=/home/user1&lt;BR /&gt;#echo $HOME&lt;BR /&gt;/home/user1&lt;BR /&gt;#pwd&lt;BR /&gt;/home/user2&lt;BR /&gt;#cd&lt;BR /&gt;#pwd&lt;BR /&gt;/home/user2   &amp;lt;-- $HOME assignament works&lt;BR /&gt;#export LOGNAME=user1&lt;BR /&gt;You can change $LOGNAME, but you never will the new user assignament.&lt;BR /&gt;#echo $LOGNAME&lt;BR /&gt;user1&lt;BR /&gt;#whoami&lt;BR /&gt;user2&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
      <pubDate>Thu, 29 Jul 2004 03:21:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344216#M191334</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2004-07-29T03:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344217#M191335</link>
      <description>If you want to have that change then use su - &lt;USERNAME&gt; &lt;BR /&gt;&lt;BR /&gt; su - &lt;USERNAME&gt; will use the profile of a particular user in the &lt;USERNAME&gt; But su will try to use the situation as "The previously defined HOME and ENV environment variables are removed"&lt;BR /&gt;&lt;BR /&gt; See su man page. It will give the difference between su with - and su without -&lt;BR /&gt;&lt;BR /&gt;&lt;/USERNAME&gt;&lt;/USERNAME&gt;&lt;/USERNAME&gt;</description>
      <pubDate>Thu, 29 Jul 2004 03:24:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344217#M191335</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-07-29T03:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344218#M191336</link>
      <description>Thanks to everybody!&lt;BR /&gt;&lt;BR /&gt;I knew that "SU - user" will get the new environment of the new user....but I want to become the new user while retaining the old environment.&lt;BR /&gt;&lt;BR /&gt;If I make "su - user" I get the new environment and I loose the old correctly.&lt;BR /&gt;&lt;BR /&gt;The solution is to export the variable (export LOGNAME, export HOME etc) but in shell script I don't know who is the firt user when I SU to the second.&lt;BR /&gt;&lt;BR /&gt;I mean:&lt;BR /&gt;&lt;BR /&gt;In the profile of the first user alpha I have:&lt;BR /&gt;&lt;BR /&gt;su - beta&lt;BR /&gt;&lt;BR /&gt;so...I become beta and I forget anything about alpha...so I can't get /home/alpha...whitout a crystal ball ;-)&lt;BR /&gt;&lt;BR /&gt;Anyway, Thanks to everybody&lt;BR /&gt;&lt;BR /&gt;Emanuele</description>
      <pubDate>Thu, 29 Jul 2004 03:55:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344218#M191336</guid>
      <dc:creator>massimo_38</dc:creator>
      <dc:date>2004-07-29T03:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344219#M191337</link>
      <description>If you use su to change login from one user to another user then $HOME settings and environment variables set in the prev. will be lost. &lt;BR /&gt;&lt;BR /&gt; But not the $LOGNAME parameter. It will be there as same as in the first login upto you use su -&lt;BR /&gt;&lt;BR /&gt; --- su man page ---&lt;BR /&gt;The previously defined HOME and ENV environment variables are removed. ( on su without - )&lt;BR /&gt;&lt;BR /&gt; I have tested the $LOGNAME parameter.&lt;BR /&gt; &lt;BR /&gt; node1&amp;gt; echo $LOGNAME&lt;BR /&gt; user1&lt;BR /&gt; node1&amp;gt; su node2 &lt;BR /&gt; node2&amp;gt; echo $LOGNAME&lt;BR /&gt; user1&lt;BR /&gt;&lt;BR /&gt; So only $HOME variable and shell variables which was set at prev. user login.</description>
      <pubDate>Thu, 29 Jul 2004 05:16:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344219#M191337</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-07-29T05:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: SU loosing $HOME parameter</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344220#M191338</link>
      <description>Hi again,&lt;BR /&gt;&lt;BR /&gt;Then save the alpha environment user's settings before any change, i.e:&lt;BR /&gt;&lt;BR /&gt;#whoami&lt;BR /&gt;alpha&lt;BR /&gt;#echo $HOME $LOGNAME&lt;BR /&gt;/home/alpha alpha&lt;BR /&gt;#env &amp;gt; old.env&lt;BR /&gt;#su - beta&lt;BR /&gt;#echo $HOME $LOGNAME&lt;BR /&gt;/home/beta beta&lt;BR /&gt;#OLD_HOME=`grep ^HOME= old.env|awk -F"=" '{ print $2 }'`&lt;BR /&gt;#OLD_LOGNAME=`grep ^LOGNAME= old.env|awk -F"=" '{ print $2 }'`&lt;BR /&gt;#echo $OLD_HOME $OLD_LOGNAME&lt;BR /&gt;/home/alpha alpha&lt;BR /&gt;#export HOME=$OLD_HOME&lt;BR /&gt;#export LOGNAME=$OLD_LOGNAME&lt;BR /&gt;#echo $HOME $LOGNAME&lt;BR /&gt;/home/alpha alpha&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
      <pubDate>Thu, 29 Jul 2004 05:47:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-loosing-home-parameter/m-p/3344220#M191338</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2004-07-29T05:47:37Z</dc:date>
    </item>
  </channel>
</rss>

