<?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: create usable persistent function in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539369#M701680</link>
    <description>Hi,&lt;BR /&gt;I found what I needed at the following webpage:&lt;BR /&gt;&lt;A href="http://www.samag.com/documents/s=1153/sam0103f/0103f.htm" target="_blank"&gt;http://www.samag.com/documents/s=1153/sam0103f/0103f.htm&lt;/A&gt;&lt;BR /&gt;I see now that it has to be autoloaded from .kshrc at each logon.&lt;BR /&gt;Gil</description>
    <pubDate>Fri, 06 May 2005 10:17:52 GMT</pubDate>
    <dc:creator>Gilbert Standen_1</dc:creator>
    <dc:date>2005-05-06T10:17:52Z</dc:date>
    <item>
      <title>create usable persistent function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539366#M701677</link>
      <description>Hi, it was suggested I post this in this forum.&lt;BR /&gt;&lt;BR /&gt;When I create a function by pasting the code to create the function into a script and run the script, the script runs but when I try to execute the function, I get the message &lt;BR /&gt;ksh: get_time2: not found&lt;BR /&gt;However, if I just paste the code to the command line, it works.&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;oracle [/m02/oracle/scripts]&lt;BR /&gt;#get_time.ksh&lt;BR /&gt;&lt;BR /&gt;oracle [/m02/oracle/scripts]&lt;BR /&gt;#get_time2&lt;BR /&gt;ksh: get_time2: not found.&lt;BR /&gt;&lt;BR /&gt;oracle [/m02/oracle/scripts]&lt;BR /&gt;#more get_time.ksh&lt;BR /&gt;function get_time2 {&lt;BR /&gt;TIME=$(date '+%m/%d/%y-%H:%M:%S')&lt;BR /&gt;printf "$TIME\n"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;oracle [/m02/oracle/scripts]&lt;BR /&gt;#function get_time2 {&lt;BR /&gt;&amp;gt; TIME=$(date '+%m/%d/%y-%H:%M:%S')&lt;BR /&gt;&amp;gt; printf "$TIME\n"&lt;BR /&gt;&amp;gt; }&lt;BR /&gt;&lt;BR /&gt;oracle [/m02/oracle/scripts]&lt;BR /&gt;#get_time2&lt;BR /&gt;05/05/05-18:20:10&lt;BR /&gt;&lt;BR /&gt;Question: how can I create the functions using code that executes within a shell script? &lt;BR /&gt;&lt;BR /&gt;BTW the function doesn't seem to "be" anywhere in a physical location (does not appear in any searches of disk).  And it is lost when you log out of your session. &lt;BR /&gt;</description>
      <pubDate>Fri, 06 May 2005 09:49:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539366#M701677</guid>
      <dc:creator>Gilbert Standen_1</dc:creator>
      <dc:date>2005-05-06T09:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: create usable persistent function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539367#M701678</link>
      <description>Source in the shell script. Use '.' before the script name on shell prompt.&lt;BR /&gt;&lt;BR /&gt;oracle [/m02/oracle/scripts]&lt;BR /&gt;# . get_time.ksh&lt;BR /&gt;</description>
      <pubDate>Fri, 06 May 2005 09:52:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539367#M701678</guid>
      <dc:creator>Amit Agarwal_1</dc:creator>
      <dc:date>2005-05-06T09:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: create usable persistent function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539368#M701679</link>
      <description>Hi,&lt;BR /&gt;Well, Amit, your reply solved part of the problem ... the function now creates from a script !  &lt;BR /&gt;&lt;BR /&gt;That is very much appreciated!! &lt;BR /&gt;&lt;BR /&gt;The command I had to use differed slightly from yours:&lt;BR /&gt;&lt;BR /&gt;. ./get_time.ksh&lt;BR /&gt;&lt;BR /&gt;Next question is, how do you get a function to persist so that whenever you login, it is there ?  The above got the function created for that session only.  Logging in to box with another session, the function is not there.</description>
      <pubDate>Fri, 06 May 2005 10:00:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539368#M701679</guid>
      <dc:creator>Gilbert Standen_1</dc:creator>
      <dc:date>2005-05-06T10:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: create usable persistent function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539369#M701680</link>
      <description>Hi,&lt;BR /&gt;I found what I needed at the following webpage:&lt;BR /&gt;&lt;A href="http://www.samag.com/documents/s=1153/sam0103f/0103f.htm" target="_blank"&gt;http://www.samag.com/documents/s=1153/sam0103f/0103f.htm&lt;/A&gt;&lt;BR /&gt;I see now that it has to be autoloaded from .kshrc at each logon.&lt;BR /&gt;Gil</description>
      <pubDate>Fri, 06 May 2005 10:17:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539369#M701680</guid>
      <dc:creator>Gilbert Standen_1</dc:creator>
      <dc:date>2005-05-06T10:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: create usable persistent function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539370#M701681</link>
      <description>If you wish you can put it in .profile. That will also work.</description>
      <pubDate>Fri, 06 May 2005 22:45:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539370#M701681</guid>
      <dc:creator>Amit Agarwal_1</dc:creator>
      <dc:date>2005-05-06T22:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: create usable persistent function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539371#M701682</link>
      <description>.profile is "dotted" by default when you log in.&lt;BR /&gt;&lt;BR /&gt;When you "dot" a file it is similar to executing a Windows style command file.  It is as if you were entering the commands therin in sequence from the command line.&lt;BR /&gt;&lt;BR /&gt;"man ksh" is a reasonable reference for this behaviour.</description>
      <pubDate>Sun, 08 May 2005 19:53:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539371#M701682</guid>
      <dc:creator>Daavid Turnbull</dc:creator>
      <dc:date>2005-05-08T19:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: create usable persistent function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539372#M701683</link>
      <description>Another command that you may wish to consider using in your .profile which will achieve much the same result is "alias".  it has a number of clevers that allow you to build and and tailor commands.</description>
      <pubDate>Sun, 08 May 2005 19:57:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-usable-persistent-function/m-p/3539372#M701683</guid>
      <dc:creator>Daavid Turnbull</dc:creator>
      <dc:date>2005-05-08T19:57:32Z</dc:date>
    </item>
  </channel>
</rss>

