<?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 How to show function body in a script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-show-function-body-in-a-script/m-p/3737163#M101159</link>
    <description>ls,&lt;BR /&gt;&lt;BR /&gt;  I have a question: Why does ksh (and sh-posix BTW) behave differently in a terminal or a script?&lt;BR /&gt;&lt;BR /&gt;Take the script below (in /tmp/tst):&lt;BR /&gt;&lt;BR /&gt;---------8&amp;lt;---------------------8&amp;lt;------------&lt;BR /&gt;#! /usr/bin/ksh -p&lt;BR /&gt;&lt;BR /&gt;function t&lt;BR /&gt;{&lt;BR /&gt; echo "This is function t"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;function u&lt;BR /&gt;{&lt;BR /&gt; echo "This is function u"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo "List all functions\ntypeset -f"&lt;BR /&gt;typeset -f&lt;BR /&gt;echo "List only function t\ntypeset -f t"&lt;BR /&gt;typeset -f t&lt;BR /&gt;---------8&amp;lt;---------------------8&amp;lt;------------&lt;BR /&gt;And execute them. The output of /tmp/tst:&lt;BR /&gt;&lt;BR /&gt;List all functions&lt;BR /&gt;typeset -f&lt;BR /&gt;function t&lt;BR /&gt;function u&lt;BR /&gt;List only function t&lt;BR /&gt;typeset -f t&lt;BR /&gt;function t&lt;BR /&gt;&lt;BR /&gt;And the output of ". /tmp/tst":&lt;BR /&gt;&lt;BR /&gt;List all functions&lt;BR /&gt;typeset -f&lt;BR /&gt;function t&lt;BR /&gt;{&lt;BR /&gt;        echo "This is function t"&lt;BR /&gt;}&lt;BR /&gt;function u&lt;BR /&gt;{&lt;BR /&gt;        echo "This is function u"&lt;BR /&gt;}&lt;BR /&gt;List only function t&lt;BR /&gt;typeset -f t&lt;BR /&gt;function t&lt;BR /&gt;{&lt;BR /&gt;        echo "This is function t"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;How come? Thanks, Edgar.</description>
    <pubDate>Wed, 22 Feb 2006 10:38:27 GMT</pubDate>
    <dc:creator>Edgar Matzinger</dc:creator>
    <dc:date>2006-02-22T10:38:27Z</dc:date>
    <item>
      <title>How to show function body in a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-show-function-body-in-a-script/m-p/3737163#M101159</link>
      <description>ls,&lt;BR /&gt;&lt;BR /&gt;  I have a question: Why does ksh (and sh-posix BTW) behave differently in a terminal or a script?&lt;BR /&gt;&lt;BR /&gt;Take the script below (in /tmp/tst):&lt;BR /&gt;&lt;BR /&gt;---------8&amp;lt;---------------------8&amp;lt;------------&lt;BR /&gt;#! /usr/bin/ksh -p&lt;BR /&gt;&lt;BR /&gt;function t&lt;BR /&gt;{&lt;BR /&gt; echo "This is function t"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;function u&lt;BR /&gt;{&lt;BR /&gt; echo "This is function u"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo "List all functions\ntypeset -f"&lt;BR /&gt;typeset -f&lt;BR /&gt;echo "List only function t\ntypeset -f t"&lt;BR /&gt;typeset -f t&lt;BR /&gt;---------8&amp;lt;---------------------8&amp;lt;------------&lt;BR /&gt;And execute them. The output of /tmp/tst:&lt;BR /&gt;&lt;BR /&gt;List all functions&lt;BR /&gt;typeset -f&lt;BR /&gt;function t&lt;BR /&gt;function u&lt;BR /&gt;List only function t&lt;BR /&gt;typeset -f t&lt;BR /&gt;function t&lt;BR /&gt;&lt;BR /&gt;And the output of ". /tmp/tst":&lt;BR /&gt;&lt;BR /&gt;List all functions&lt;BR /&gt;typeset -f&lt;BR /&gt;function t&lt;BR /&gt;{&lt;BR /&gt;        echo "This is function t"&lt;BR /&gt;}&lt;BR /&gt;function u&lt;BR /&gt;{&lt;BR /&gt;        echo "This is function u"&lt;BR /&gt;}&lt;BR /&gt;List only function t&lt;BR /&gt;typeset -f t&lt;BR /&gt;function t&lt;BR /&gt;{&lt;BR /&gt;        echo "This is function t"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;How come? Thanks, Edgar.</description>
      <pubDate>Wed, 22 Feb 2006 10:38:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-show-function-body-in-a-script/m-p/3737163#M101159</guid>
      <dc:creator>Edgar Matzinger</dc:creator>
      <dc:date>2006-02-22T10:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to show function body in a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-show-function-body-in-a-script/m-p/3737164#M101160</link>
      <description>ls,&lt;BR /&gt;&lt;BR /&gt;  I've forgotten to mention: HP-UX 11.00,&lt;BR /&gt;11.11 and 11.23&lt;BR /&gt;&lt;BR /&gt;MTIA, cu l8r, Edgar.</description>
      <pubDate>Wed, 22 Feb 2006 10:40:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-show-function-body-in-a-script/m-p/3737164#M101160</guid>
      <dc:creator>Edgar Matzinger</dc:creator>
      <dc:date>2006-02-22T10:40:32Z</dc:date>
    </item>
  </channel>
</rss>

