<?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: interesting unix problems in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072554#M904976</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Check the following script.&lt;BR /&gt;&lt;BR /&gt;$cat scr&lt;BR /&gt;&lt;BR /&gt;. ./aliases.sh&lt;BR /&gt;&lt;BR /&gt;printf "enter your name:"&lt;BR /&gt;read name&lt;BR /&gt;echo "This is from interaction - $name"&lt;BR /&gt;echo "Below is the alias doit"&lt;BR /&gt;doit&lt;BR /&gt;&lt;BR /&gt;$cat aliases.sh&lt;BR /&gt;alias doit="echo this is doit"&lt;BR /&gt;&lt;BR /&gt;$./scr&lt;BR /&gt;enter your name:test&lt;BR /&gt;This is from interaction - test&lt;BR /&gt;Below is the alias doit&lt;BR /&gt;this is doit&lt;BR /&gt;&lt;BR /&gt;You can define alias in the original script itself if you want.&lt;BR /&gt;&lt;BR /&gt;See if it helps you.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 16 Sep 2003 17:09:56 GMT</pubDate>
    <dc:creator>Sridhar Bhaskarla</dc:creator>
    <dc:date>2003-09-16T17:09:56Z</dc:date>
    <item>
      <title>interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072553#M904975</link>
      <description>1. Can anyone suggest how to make ksh execute some scripts and stay interactive?&lt;BR /&gt;&lt;BR /&gt;The idea was to open a new ksh with preset aliases and aliases exporting does not work.&lt;BR /&gt;&lt;BR /&gt;2. Does any one have an example of aliases exporting?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 16 Sep 2003 16:58:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072553#M904975</guid>
      <dc:creator>Sergey_27</dc:creator>
      <dc:date>2003-09-16T16:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072554#M904976</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Check the following script.&lt;BR /&gt;&lt;BR /&gt;$cat scr&lt;BR /&gt;&lt;BR /&gt;. ./aliases.sh&lt;BR /&gt;&lt;BR /&gt;printf "enter your name:"&lt;BR /&gt;read name&lt;BR /&gt;echo "This is from interaction - $name"&lt;BR /&gt;echo "Below is the alias doit"&lt;BR /&gt;doit&lt;BR /&gt;&lt;BR /&gt;$cat aliases.sh&lt;BR /&gt;alias doit="echo this is doit"&lt;BR /&gt;&lt;BR /&gt;$./scr&lt;BR /&gt;enter your name:test&lt;BR /&gt;This is from interaction - test&lt;BR /&gt;Below is the alias doit&lt;BR /&gt;this is doit&lt;BR /&gt;&lt;BR /&gt;You can define alias in the original script itself if you want.&lt;BR /&gt;&lt;BR /&gt;See if it helps you.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Sep 2003 17:09:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072554#M904976</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-09-16T17:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072555#M904977</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xe88093e260b0d611abdb0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xe88093e260b0d611abdb0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Tue, 16 Sep 2003 17:12:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072555#M904977</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-09-16T17:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072556#M904978</link>
      <description>I would think that one solution is to setup your environment variables in a file and then source them when you run the ksh command:&lt;BR /&gt;&lt;BR /&gt;ie:&lt;BR /&gt;&lt;BR /&gt;/tmp/your_file_with_vars:&lt;BR /&gt;&lt;BR /&gt;alias new=vi&lt;BR /&gt;alias ll="ls -al"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then just after you run the ksh command just source that file. To source a file enter the dot "." then a space then the path to the file:&lt;BR /&gt;&lt;BR /&gt;root&amp;gt; . /tmp/your_file_with_vars&lt;BR /&gt;&lt;BR /&gt;any environment vars setup in that file will stay in the shell until you exit the shell.</description>
      <pubDate>Tue, 16 Sep 2003 17:12:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072556#M904978</guid>
      <dc:creator>John Dvorchak</dc:creator>
      <dc:date>2003-09-16T17:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072557#M904979</link>
      <description>Sri, &lt;BR /&gt;that was not aliases exporting.&lt;BR /&gt;You defined aliases in the same shell as script scr runs by sourcing aliases file.</description>
      <pubDate>Tue, 16 Sep 2003 17:19:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072557#M904979</guid>
      <dc:creator>Sergey_27</dc:creator>
      <dc:date>2003-09-16T17:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072558#M904980</link>
      <description>Hi Sergei,&lt;BR /&gt;&lt;BR /&gt;Look at the man page of ksh&lt;BR /&gt;&lt;BR /&gt;//keywords listed above.  Aliases can be created, listed, and exported&lt;BR /&gt;      with the alias command and can be removed with the unalias command.&lt;BR /&gt;      Exported aliases remain in effect for subshells but must be&lt;BR /&gt;      reinitialized for separate invocations of the shell (see Invoking ksh&lt;BR /&gt;      below).&lt;BR /&gt;//&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If it is a seperate invocation of the shell, then, you will have to source in the aliases again which was what I did. There are few aliases compiled into ksh itself that are available to all the shells. &lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Sep 2003 17:27:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072558#M904980</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-09-16T17:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072559#M904981</link>
      <description>Sri,&lt;BR /&gt;&lt;BR /&gt;Do you have an example that show that alias is effective for a sub-shell without re-initialization? To me if you have to define alias again it was not exported.&lt;BR /&gt;&lt;BR /&gt;It looks like "alias -x" is useless.&lt;BR /&gt;&lt;BR /&gt;John,&lt;BR /&gt;&lt;BR /&gt;I can put aliases in the file no problem, but&lt;BR /&gt;how can I execute that file automatically and leave that shell running without going into trouble of installing expect?&lt;BR /&gt;&lt;BR /&gt;Thanks for all your help  &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Sep 2003 17:46:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072559#M904981</guid>
      <dc:creator>Sergey_27</dc:creator>
      <dc:date>2003-09-16T17:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072560#M904982</link>
      <description>Ok I think I know what you are asking for. You want to run a new shell and have it source your env parms with aliases etc. Then from the script that you run in the new shell place the line:&lt;BR /&gt;&lt;BR /&gt;. /tmp/your_parm_file&lt;BR /&gt;&lt;BR /&gt;on a line by itself in that script.&lt;BR /&gt;&lt;BR /&gt;Maybe I am not understanding what specifically you want to do. Let me know.&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Sep 2003 17:58:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072560#M904982</guid>
      <dc:creator>John Dvorchak</dc:creator>
      <dc:date>2003-09-16T17:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072561#M904983</link>
      <description>Well I guess I understand what you are trying to do now.&lt;BR /&gt;&lt;BR /&gt;See if this works.&lt;BR /&gt;&lt;BR /&gt;ENV='${MyFILE[ (_$- = 1) + (_ = 0) - (_$- != _${-%%*i*}) ]}'&lt;BR /&gt;MYFILE=~/.kshrc&lt;BR /&gt;export ENV MYFILE&lt;BR /&gt;&lt;BR /&gt;Put the above in your .profile and login again. Then the aliases in .kshrc should be available to all your subsequent subshells.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Sep 2003 17:59:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072561#M904983</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-09-16T17:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072562#M904984</link>
      <description>Also Sergei,&lt;BR /&gt;&lt;BR /&gt;Look at the following document for more hints&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/hpux/onlinedocs/B2355-90046/B2355-90046.html" target="_blank"&gt;http://docs.hp.com/hpux/onlinedocs/B2355-90046/B2355-90046.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Particularly the "Advanced Concepts" where it explains about ENV variable.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Tue, 16 Sep 2003 18:12:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072562#M904984</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-09-16T18:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072563#M904985</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have the following in my .profile&lt;BR /&gt;&lt;BR /&gt;export ENV=$HOME/.kshrc&lt;BR /&gt;&lt;BR /&gt;And the aliases is defined in .kshrc.</description>
      <pubDate>Tue, 16 Sep 2003 18:20:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072563#M904985</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2003-09-16T18:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: interesting unix problems</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072564#M904986</link>
      <description>Thanks everybody,&lt;BR /&gt;&lt;BR /&gt;to summarize:&lt;BR /&gt;&lt;BR /&gt;1. export ENV=filename and ksh will execute that file and stay interactive&lt;BR /&gt;&lt;BR /&gt;2. export of aliases does not work but thats ok because ENV in #1 could be dynamic and all aliases could go there.&lt;BR /&gt;&lt;BR /&gt;Thanks!!!</description>
      <pubDate>Tue, 16 Sep 2003 18:23:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interesting-unix-problems/m-p/3072564#M904986</guid>
      <dc:creator>Sergey_27</dc:creator>
      <dc:date>2003-09-16T18:23:07Z</dc:date>
    </item>
  </channel>
</rss>

