<?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: passed environment variables when using remsh in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887310#M401699</link>
    <description>The script or process you run after issuing the remesh command must set all needed variables.&lt;BR /&gt;&lt;BR /&gt;There is no alternative and passing DISPLAY for example from one machine to another won't work anyway. &lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Tue, 22 Feb 2005 15:16:52 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2005-02-22T15:16:52Z</dc:date>
    <item>
      <title>passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887304#M401693</link>
      <description>what environment variables, if any, are preserved when using remsh?&lt;BR /&gt;&lt;BR /&gt;hostA (user toad)&amp;gt; remsh hostB -l frog "echo what gets carried over from user toad for user frog?"&lt;BR /&gt;&lt;BR /&gt;i know most are not ...like DISPLAY, SHELL, etc...&lt;BR /&gt;&lt;BR /&gt;thx, marc</description>
      <pubDate>Tue, 22 Feb 2005 13:41:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887304#M401693</guid>
      <dc:creator>Marc Ahrendt</dc:creator>
      <dc:date>2005-02-22T13:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887305#M401694</link>
      <description>Hi Marc,&lt;BR /&gt;&lt;BR /&gt;AFAIK it passes none.&lt;BR /&gt;Instead it will source the remote user's appropriate .profile .kshrc .cshrc - whatever is appropriate for that user's shell.&lt;BR /&gt;IF you need a specific env set up you'll need the remote command to source a file or run a script from the remotely called script.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 22 Feb 2005 13:53:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887305#M401694</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2005-02-22T13:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887306#M401695</link>
      <description>Remsh will open a login shell on the other side, and environnement will be as if you logged with telnet.&lt;BR /&gt;&lt;BR /&gt;If you want to have environment variables go to the other side, pass them as argument to a script.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Feb 2005 14:02:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887306#M401695</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2005-02-22T14:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887307#M401696</link>
      <description>remsh does not login like rlogin or telnet, so it has a VERY MINIMAL environment, nothing from the local system. To see the environment:&lt;BR /&gt; &lt;BR /&gt;remsh systemb env&lt;BR /&gt;remsh systemb set&lt;BR /&gt; &lt;BR /&gt;The first shows exported variables and the second shows all variables. If you assume that nothing is setup when you use remsh, then you'll be safe. You'll have to run /etc/profile and .profile as part of your remsh command. Otherwise, you have to use rlogin to get the remote user's environment.&lt;BR /&gt; &lt;BR /&gt;Carrying over local variables doesn't always make any sense (ie, SHELL is meaningless on the remote system unless it happens to match). DISPLAY makes sense but only telnet can transport a local variable (it happens to be TERM), remsh cannot. The important difference about remsh is that it is not a terminal process...it looks like one but if you try this:&lt;BR /&gt; &lt;BR /&gt;remsh systemb who -muR&lt;BR /&gt; &lt;BR /&gt;you'll get an error that who cannot identify the incoming terminal connection. So the key is to carry the DISPLAY variable in your command as in:&lt;BR /&gt; &lt;BR /&gt;remsh systemb /usr/bin/X11/xclock -display $DISPLAY&lt;BR /&gt; &lt;BR /&gt;Now this ASSUMES that DISPLAY is set to your IPaddr:0.0</description>
      <pubDate>Tue, 22 Feb 2005 14:35:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887307#M401696</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-02-22T14:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887308#M401697</link>
      <description>Jeff, thx but what is AFAIK? and also your comment is incorrect about sourcing the .profile (remsh does not do that automatically) ...see Bill's comments below&lt;BR /&gt;&lt;BR /&gt;Fred, thx because your comment made me just realize my mistake in posting my question! the issue is not with remsh but RLOGIN!&lt;BR /&gt;&lt;BR /&gt;Bill, thx for the great feedback but again my mistake was that i meant RLOGIN not remsh&lt;BR /&gt;&lt;BR /&gt;1) i am using rlogin ...not remsh as i wrongly stated earlier (sorry)&lt;BR /&gt;&lt;BR /&gt;2) i am using the following command&lt;BR /&gt;     rlogin hostB -l frog&lt;BR /&gt;&lt;BR /&gt;3) the account frog on hostB is a "captive" account where everything is done in .profile and exits the account after .profile is done&lt;BR /&gt;&lt;BR /&gt;4) Bill made a statement that is really what i mean ...i want to "transport a local variable" using rlogin to the .profile on the remote host, but i just do not know what local variables qualify!?! i just want to know if any qualify.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Feb 2005 15:00:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887308#M401697</guid>
      <dc:creator>Marc Ahrendt</dc:creator>
      <dc:date>2005-02-22T15:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887309#M401698</link>
      <description>AFAIK = As Far As I Know&lt;BR /&gt;&lt;BR /&gt;It doesn't matter which of the r* services (remsh, rlogin, whatever) you use, the answer is the same.  Nothing is taken from one machine to another.</description>
      <pubDate>Tue, 22 Feb 2005 15:16:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887309#M401698</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-02-22T15:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887310#M401699</link>
      <description>The script or process you run after issuing the remesh command must set all needed variables.&lt;BR /&gt;&lt;BR /&gt;There is no alternative and passing DISPLAY for example from one machine to another won't work anyway. &lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 22 Feb 2005 15:16:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887310#M401699</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-02-22T15:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887311#M401700</link>
      <description>Hi (again) marc,&lt;BR /&gt;&lt;BR /&gt;Well I should have been a little more explicit.&lt;BR /&gt;IF the default remote shell is /usr/bin/sh or /usr/bin/ksh THEN the following will run it&lt;BR /&gt;&lt;BR /&gt;remsh hostb . .profile 2&amp;gt;&amp;amp;- \; rem_command&lt;BR /&gt;&lt;BR /&gt;and set up the env before the command is executed. And of course that command can simply be a shell.&lt;BR /&gt;I really would look at setting up the env properly on the remote host using remsh rather then hoping you can pass env vars in rlogin because I just don't think it can be done.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff&lt;BR /&gt;&lt;BR /&gt;P.S.  AFAIK  - As Far As I Know</description>
      <pubDate>Tue, 22 Feb 2005 15:19:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887311#M401700</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2005-02-22T15:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887312#M401701</link>
      <description>OK, remsh propagates nothing because it does not have a terminal concept. rlogin does have a terminal concept (it is interactive) so (see man rlogin) TERM is propagated to the remote system. But that's all. This is identical to telnet which is also proagated to the remote machine.&lt;BR /&gt; &lt;BR /&gt;However, that is not a good thing anymore. In old Unix days, terminal characteristics such as baud rate, parity, etc, needed to be propagated and each flavor of the rlogin or telnet daemon would use these to setup local behavior. Today, the underlying (and rather detailed) protocol handshake that you never see will handle this. But it leaves TERM defined at the remote system *prior* to running /etc/profile and .profile--this is not good. For instance, if you're on a Linux box and telnet/rlogin to HP-UX, /etc/profile will inherit TERM=linux, a bad thing because the terminfo library knows nothing about "linux" as a terminal (untic linux). And Windows may set something like TERM=ansi or whatever terminal emulator you are using on the PC.&lt;BR /&gt; &lt;BR /&gt;So /etc/profile should be coded to NEVER use what it inherits for TERM. Instead, let ttytype probe your terminal automatically for the TERM variable. Get rid of the: if [ $TERM = something ] and replace all of that with:&lt;BR /&gt; &lt;BR /&gt;exec $(ttytype -s)&lt;BR /&gt; &lt;BR /&gt;Now your terminal setting on the remote side will be correct. ttytype will set TERM LINES and COLUMNS automatically. Run ttytype -s to see what it does.</description>
      <pubDate>Tue, 22 Feb 2005 16:08:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887312#M401701</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-02-22T16:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887313#M401702</link>
      <description>Another way to pass env variable to the remote&lt;BR /&gt;system would be the following:&lt;BR /&gt;&lt;BR /&gt;$ remsh REMOTE_MACH_NAME 'xclock'&lt;BR /&gt;Error: Can't open display&lt;BR /&gt;&lt;BR /&gt;$ remsh REMOTE_MACH_NAME 'DISPLAY=display_mach:0.0  xclock'&lt;BR /&gt;.. works like magic :-)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Feb 2005 16:27:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887313#M401702</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-02-22T16:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: passed environment variables when using remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887314#M401703</link>
      <description>thx Biswajit but i was aware of remsh usage ...just not ware of the what environment variables got "transported" over (seems for all practical purposes that its none) when using it or, of more interest to me, rlogin&lt;BR /&gt;&lt;BR /&gt;thx Patrick/Steve/Jeff for the feedback&lt;BR /&gt;&lt;BR /&gt;thx Bill for the detail/explanation i was looking for about not only the sole env var. TERM that does qualify, but just that it is a best practice (as others stated above) to use the r* commands with needed env.s on the remote account itself</description>
      <pubDate>Tue, 22 Feb 2005 18:45:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passed-environment-variables-when-using-remsh/m-p/4887314#M401703</guid>
      <dc:creator>Marc Ahrendt</dc:creator>
      <dc:date>2005-02-22T18:45:55Z</dc:date>
    </item>
  </channel>
</rss>

