<?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 ksh ENV variable in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039042#M432491</link>
    <description>Hello.&lt;BR /&gt;&lt;BR /&gt;Can I somehow source more than one file in the ENV variable in ksh ?&lt;BR /&gt;&lt;BR /&gt;Usually it's set to $HOME/.kshrc but I'd like to source for example a global /etc/kshrc AND then $HOME/.kshrc&lt;BR /&gt;&lt;BR /&gt;The problem is that I have several users spread over several machines and they all have their own .kshrc. Now I want to add some aliases to their shell, but I don't want to edit every users $HOME/.kshrc&lt;BR /&gt;&lt;BR /&gt;If I set the aliases in /etc/profile they are there as they should in the login shell, but if I change shell, or run a script, they won't  be in the new shell that's executed, that's why I think I need to set them in a global kshrc aswell.</description>
    <pubDate>Tue, 10 Apr 2007 03:33:18 GMT</pubDate>
    <dc:creator>Johan Bergström</dc:creator>
    <dc:date>2007-04-10T03:33:18Z</dc:date>
    <item>
      <title>ksh ENV variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039042#M432491</link>
      <description>Hello.&lt;BR /&gt;&lt;BR /&gt;Can I somehow source more than one file in the ENV variable in ksh ?&lt;BR /&gt;&lt;BR /&gt;Usually it's set to $HOME/.kshrc but I'd like to source for example a global /etc/kshrc AND then $HOME/.kshrc&lt;BR /&gt;&lt;BR /&gt;The problem is that I have several users spread over several machines and they all have their own .kshrc. Now I want to add some aliases to their shell, but I don't want to edit every users $HOME/.kshrc&lt;BR /&gt;&lt;BR /&gt;If I set the aliases in /etc/profile they are there as they should in the login shell, but if I change shell, or run a script, they won't  be in the new shell that's executed, that's why I think I need to set them in a global kshrc aswell.</description>
      <pubDate>Tue, 10 Apr 2007 03:33:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039042#M432491</guid>
      <dc:creator>Johan Bergström</dc:creator>
      <dc:date>2007-04-10T03:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: ksh ENV variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039043#M432492</link>
      <description>&amp;gt;Can I somehow source more than one file in the ENV variable in ksh?&lt;BR /&gt;&lt;BR /&gt;No.  The best you can do is source a new file then source /etc/kshrc AND then $HOME/.kshrc.&lt;BR /&gt;&lt;BR /&gt;Anyway, why do you have any control over ENV?  I reset it in my .profile, why would you expect your users to do anything different?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;that's why I think I need to set them in a global kshrc as well.&lt;BR /&gt;&lt;BR /&gt;That's correct.  But if you are offering a service with these aliases, your users should be glad to change their .kshrc files and source your new file.&lt;BR /&gt;&lt;BR /&gt;Of course if these aliases are part of a management stick, I can see why they wouldn't.  ;-)</description>
      <pubDate>Tue, 10 Apr 2007 03:40:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039043#M432492</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-10T03:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: ksh ENV variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039044#M432493</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Did you check the global function feature of ksh. May be it can be an option for you in this case.</description>
      <pubDate>Tue, 10 Apr 2007 05:58:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039044#M432493</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2007-04-10T05:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: ksh ENV variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039045#M432494</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;it depends on the way, where $ENV is set:&lt;BR /&gt;If you do that in /etc/profile, you have won:&lt;BR /&gt;Modify the setting to:&lt;BR /&gt;ENV=/usr/local/etc/ksh.aliases&lt;BR /&gt;export ENV&lt;BR /&gt;&lt;BR /&gt;and at the end of /usr/local/etc/ksh.aliases&lt;BR /&gt;add something like:&lt;BR /&gt;&lt;BR /&gt;if alias setglobalaliases 2&amp;gt;/dev/null&lt;BR /&gt;then :&lt;BR /&gt;elif [ -s ~/.kshrc ]&lt;BR /&gt;then . ~/.kshrc&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;When the above condition is not met, you'll have to do it the other way round:&lt;BR /&gt;Add an anchor - similar to the above solution -  to every .kshrc (you have to change this for every existing user only once):&lt;BR /&gt;&lt;BR /&gt;if alias setglobalaliases 2&amp;gt;/dev/null&lt;BR /&gt;then :&lt;BR /&gt;elif [ -s /usr/local/etc/ksh.aliases ]&lt;BR /&gt;then . /usr/local/etc/ksh.aliases&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In both cases, add into your global aliases-file the anchor-alias and your other stuff:&lt;BR /&gt;cat /usr/local/etc/ksh.aliases&lt;BR /&gt;alias setglobalaliases=true&lt;BR /&gt;alias lspr='lpstat -o$PRINTER'&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 10 Apr 2007 10:12:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039045#M432494</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-04-10T10:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: ksh ENV variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039046#M432495</link>
      <description>Actually ENV should be this complicated string and then you set FILE or some other variable to your actual file:&lt;BR /&gt;export ENV='${FILE[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'&lt;BR /&gt;&lt;BR /&gt;This doesn't set aliases for scripts, only interactive shells.</description>
      <pubDate>Wed, 11 Apr 2007 00:46:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039046#M432495</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-11T00:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: ksh ENV variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039047#M432496</link>
      <description>Dennis, that only checks if the shell is interactive or not.&lt;BR /&gt;&lt;BR /&gt;Anyway, I solved my problem without using aliases at all, fiddeling with the PATH variable instead.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help tho.</description>
      <pubDate>Wed, 11 Apr 2007 02:16:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039047#M432496</guid>
      <dc:creator>Johan Bergström</dc:creator>
      <dc:date>2007-04-11T02:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: ksh ENV variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039048#M432497</link>
      <description>Solved the problem elsewhere, didn't use aliases or the ENV variable at all.</description>
      <pubDate>Wed, 11 Apr 2007 02:21:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039048#M432497</guid>
      <dc:creator>Johan Bergström</dc:creator>
      <dc:date>2007-04-11T02:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: ksh ENV variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039049#M432498</link>
      <description>&amp;gt;That only checks if the shell is interactive or not.&lt;BR /&gt;&lt;BR /&gt;Exactly, if you aren't interactive, you shouldn't be using aliases, etc.  It makes your scripts/subshells start faster.</description>
      <pubDate>Wed, 11 Apr 2007 02:34:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-env-variable/m-p/5039049#M432498</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-11T02:34:54Z</dc:date>
    </item>
  </channel>
</rss>

