<?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: scripts running as /bin/sh in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737155#M66835</link>
    <description>/bin (and /lib) as mentioned do not exist on HP-UX (or Solaris for that matter).  The industry standards (SysV.4 layout) about 10 years ago decided that /bin and /lib need to be migrated along with many other directory names and files. However, Unix applications tend to lag behind by about 5-8 years in following industry stadards so HP added the transition link concept, a symbolic link that replaces the old directory with a pointer to the new (preferred) one.&lt;BR /&gt;&lt;BR /&gt;There is good and bad news with that: the good news is that old scripts will still run as usual (assuming they have the #/bin/sh header), and there are many flavors of Unix that still don't conform so the scripts will still work.&lt;BR /&gt;&lt;BR /&gt;The bad news is that /bin/sh 'looks' like the Bourne shell and this scares users into using good old ksh. Also, changing the shebang (the #!/ header that specifies which interpreter to use) to #!/usr/bin/sh may break the script on other platforms. And transition links are optional--which means that a new administrator may look at the industry standards and decide to remove the transition links, thus breaking many scripts.&lt;BR /&gt;&lt;BR /&gt;The future of transition links is not guarenteed! A new version of HP-UX may default to no links by default, and further revisions may not provide them.&lt;BR /&gt;&lt;BR /&gt;One note about POSIX shells: HP-UX POSIX shell (which is stored in two formats in /usr/bin and /sbin) is one of many 'POSIX' shells. The Korn shell (as well as bash) are POSIX compliant which is why the vast majority of ksh and bash scripts run just fine using /usr/bin/sh. There is a great list that defines the differences (not many and pretty esoteric) in the 10.xx Release Notes in /usr/share/doc. For instance, ulimit has full functionality in the HP POSIX shell and bash (type ulimit -a) but ksh does not.</description>
    <pubDate>Tue, 04 Jun 2002 17:55:39 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2002-06-04T17:55:39Z</dc:date>
    <item>
      <title>scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737144#M66824</link>
      <description>Hi All:&lt;BR /&gt;&lt;BR /&gt;  We have several scripts and codes running on 11.0. The developers somehow prefer /bin/sh to run their programs from. I welcome all the gurus to comment on this practise.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Brian.</description>
      <pubDate>Tue, 04 Jun 2002 13:34:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737144#M66824</guid>
      <dc:creator>brian_31</dc:creator>
      <dc:date>2002-06-04T13:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737145#M66825</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;/usr/bin/sh (bourne shell) is the most basic shell that comes with all OSes. Thus, using this shell makes it portable across UNIX platforms.&lt;BR /&gt;&lt;BR /&gt;If say you use /usr/bin/ksh and you want to port the script to Solaris, the additional effort to install the korn shell is needed.&lt;BR /&gt;&lt;BR /&gt;Also, because it has less fanciful stuff, I believe the binary is smaller and more efficient.&lt;BR /&gt;&lt;BR /&gt;Portability and less resource intensive.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Tue, 04 Jun 2002 13:38:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737145#M66825</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-06-04T13:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737146#M66826</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Remember some things :&lt;BR /&gt;&lt;BR /&gt;for ROOT always use /sbin/sh&lt;BR /&gt;&lt;BR /&gt;You can /bin/sh for the users- there are no issues. You can also use /usr/bin/ksh ( Korn shell ) and /usr/bin/sh ( Bourne shell )for the users which givves you other advantages also.&lt;BR /&gt;&lt;BR /&gt;Piyush&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jun 2002 13:41:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737146#M66826</guid>
      <dc:creator>PIYUSH D. PATEL</dc:creator>
      <dc:date>2002-06-04T13:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737147#M66827</link>
      <description>Hi Brian &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You may like at the following :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uswebsites.com/support/cgi_scripts.shtml" target="_blank"&gt;http://www.uswebsites.com/support/cgi_scripts.shtml&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://google.yahoo.com/bin/query?p=developers+prefer+%2fbin%2fsh&amp;amp;hc=0&amp;amp;hs=0" target="_blank"&gt;http://google.yahoo.com/bin/query?p=developers+prefer+%2fbin%2fsh&amp;amp;hc=0&amp;amp;hs=0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; It is more of a legacy , than any thing else .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jun 2002 13:41:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737147#M66827</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-06-04T13:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737148#M66828</link>
      <description>It makes no difference; these are identical versions of the POSIX shell. The Bourne shell is /usr/old/bin/sh. I suppose that my only objection is that /usr/bin/sh is the more 'standard' location but almost every UNIX box has a copy of sh in both /bin and /usr/bin. The real problem occurs if your developer's are using /bin/sh in the mistaken assumption that this is the Bourne shell.&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jun 2002 13:47:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737148#M66828</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-04T13:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737149#M66829</link>
      <description>Brian,&lt;BR /&gt;&lt;BR /&gt;On HPUX, the /bin/sh is a hard linked to /usr/bin/sh. It's the POSIX shell, I believe it's the default shell. In may areas, it is similar to the Korn shell. e.g. it has shell history, support job control and other stuffs.&lt;BR /&gt;&lt;BR /&gt;If you need a comparision of various shells on HP, try the "man sh".&lt;BR /&gt;&lt;BR /&gt;Hope it helps.</description>
      <pubDate>Tue, 04 Jun 2002 13:48:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737149#M66829</guid>
      <dc:creator>Enbin Hu</dc:creator>
      <dc:date>2002-06-04T13:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737150#M66830</link>
      <description>Hi Brian,&lt;BR /&gt;&lt;BR /&gt;/usr/bin/sh on HP-UX is the POSIX shell which is allmost the same than Korn shell. &lt;BR /&gt;&lt;BR /&gt;/usr/bin/ksh is the Korn shell, very similar to POSIX shell&lt;BR /&gt;&lt;BR /&gt;/sbin/sh is the superuser shell, should be the shell for root on every computer!&lt;BR /&gt;&lt;BR /&gt;/usr/bin/csh the c- shell, which uses a different syntax, near to the programming language C.&lt;BR /&gt;&lt;BR /&gt;/usr/old/bin/sh on HP-UX the Bourne shell, which is very old and not comfortable at all, no history, no file name generation and so on....&lt;BR /&gt;&lt;BR /&gt;To get scripts, which run not platform dependant, you could use /usr/bin/ksh, which is available on allmost every platform. Remember, not every shell has the same syntax, but POSIX and Korn shell have.&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Tue, 04 Jun 2002 13:51:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737150#M66830</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-06-04T13:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737151#M66831</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Oops, I have made a mistake. As indicated by the rest, it is the POSIX shell, not the Bourne shell.&lt;BR /&gt;&lt;BR /&gt;I personally still prefer /usr/bin/sh because it is available on default across Unixes and Linuxes. Makes it easier for me to port it across platforms. If I use bash (bourne-again shell, should be right this time ;) ), then I have to specifically install it on the other Unix platform that does not support it by default.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Tue, 04 Jun 2002 13:52:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737151#M66831</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-06-04T13:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737152#M66832</link>
      <description>Just do 'ls -al' at the root prompt, you will find actually the /bin is linked to /usr/bin. So it doesn't make any difference if you use /bin/sh or /usr/bin/sh. The thing is /usr/bin/sh is the more acceptable standard path.</description>
      <pubDate>Tue, 04 Jun 2002 13:54:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737152#M66832</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2002-06-04T13:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737153#M66833</link>
      <description>After all that's been said I prefer to use /usr/bin/sh as the path for portability.</description>
      <pubDate>Tue, 04 Jun 2002 13:56:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737153#M66833</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-06-04T13:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737154#M66834</link>
      <description>See this:&lt;BR /&gt;&lt;BR /&gt;systemname&amp;gt;ll -d /bin /usr/bin /sbin                                                                                        &lt;BR /&gt;lr-xr-xr-t   1 root       sys              8 Mar  6 08:52 /bin -&amp;gt; /usr/bin                                                          &lt;BR /&gt;dr-xr-xr-x  12 bin        bin           3072 Apr 29 05:08 /sbin                                                                     &lt;BR /&gt;dr-xr-xr-x   6 bin        bin          10240 Jun  3 05:11 /usr/bin                                                                  &lt;BR /&gt;systemname&amp;gt;ll -d /bin/sh /usr/bin/sh  /sbin/sh                                                                              &lt;BR /&gt;-r-xr-xr-x   2 bin        bin         221184 Apr 23  2001 /bin/sh                                                                   &lt;BR /&gt;-r-xr-xr-x   1 bin        bin         421888 Apr 23  2001 /sbin/sh                                                                  &lt;BR /&gt;-r-xr-xr-x   2 bin        bin         221184 Apr 23  2001 /usr/bin/sh                                                               &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/bin is a transition link to /usr/bin. It could be removed in any version. /bin/sh /usr/bin/sh is the same.&lt;BR /&gt;&lt;BR /&gt;see man tlinstall tlremove.</description>
      <pubDate>Tue, 04 Jun 2002 14:05:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737154#M66834</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2002-06-04T14:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737155#M66835</link>
      <description>/bin (and /lib) as mentioned do not exist on HP-UX (or Solaris for that matter).  The industry standards (SysV.4 layout) about 10 years ago decided that /bin and /lib need to be migrated along with many other directory names and files. However, Unix applications tend to lag behind by about 5-8 years in following industry stadards so HP added the transition link concept, a symbolic link that replaces the old directory with a pointer to the new (preferred) one.&lt;BR /&gt;&lt;BR /&gt;There is good and bad news with that: the good news is that old scripts will still run as usual (assuming they have the #/bin/sh header), and there are many flavors of Unix that still don't conform so the scripts will still work.&lt;BR /&gt;&lt;BR /&gt;The bad news is that /bin/sh 'looks' like the Bourne shell and this scares users into using good old ksh. Also, changing the shebang (the #!/ header that specifies which interpreter to use) to #!/usr/bin/sh may break the script on other platforms. And transition links are optional--which means that a new administrator may look at the industry standards and decide to remove the transition links, thus breaking many scripts.&lt;BR /&gt;&lt;BR /&gt;The future of transition links is not guarenteed! A new version of HP-UX may default to no links by default, and further revisions may not provide them.&lt;BR /&gt;&lt;BR /&gt;One note about POSIX shells: HP-UX POSIX shell (which is stored in two formats in /usr/bin and /sbin) is one of many 'POSIX' shells. The Korn shell (as well as bash) are POSIX compliant which is why the vast majority of ksh and bash scripts run just fine using /usr/bin/sh. There is a great list that defines the differences (not many and pretty esoteric) in the 10.xx Release Notes in /usr/share/doc. For instance, ulimit has full functionality in the HP POSIX shell and bash (type ulimit -a) but ksh does not.</description>
      <pubDate>Tue, 04 Jun 2002 17:55:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737155#M66835</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-06-04T17:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737156#M66836</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Indeed, all are POSIX shells.&lt;BR /&gt;&lt;BR /&gt;One thing to add, maybe. The 'superuser shell', /sbin/sh, is a statically linked POSIX shell. This is required for running a shell in single user mode (i.e. when /usr is not mounted and the shared libraries are not accessible).&lt;BR /&gt;&lt;BR /&gt;Rik.</description>
      <pubDate>Tue, 04 Jun 2002 19:12:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737156#M66836</guid>
      <dc:creator>RikTytgat</dc:creator>
      <dc:date>2002-06-04T19:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737157#M66837</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;  /bin/sh is never the right path. It should be /usr/sbin/sh and the same applies to /lib also. Take a case where an administrator may run "tlremove" and all the /bin codes would break. As Bill pointed out it is a mere symbolic link for old codes.&lt;BR /&gt;&lt;BR /&gt;Giri Sekar.</description>
      <pubDate>Tue, 04 Jun 2002 19:31:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737157#M66837</guid>
      <dc:creator>Giri Sekar.</dc:creator>
      <dc:date>2002-06-04T19:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: scripts running as /bin/sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737158#M66838</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;   Thanks for your time. It was a great learning experience. I never knew a command called "tlremove" before. I will make sure the guys here stick to /usr/bin/sh.&lt;BR /&gt;&lt;BR /&gt;Thanks again&lt;BR /&gt;Brian</description>
      <pubDate>Tue, 04 Jun 2002 19:36:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-running-as-bin-sh/m-p/2737158#M66838</guid>
      <dc:creator>brian_31</dc:creator>
      <dc:date>2002-06-04T19:36:28Z</dc:date>
    </item>
  </channel>
</rss>

