git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: /bin/sh portability question

From
HAH. Peter Anvin <hpa@zytor.com>
Date
Sep 23, 2005, 20:00 UTC
Message-ID
<43345EED.5060706@zytor.com>
In-Reply-To
<20050923195706.GV27375@ca-server1.us.oracle.com>
Joel Becker wrote:
Show 15 quoted lines
> On Fri, Sep 23, 2005 at 12:48:39PM -0700, H. Peter Anvin wrote:
> 
>>Peter Eriksen wrote:
>>
>>>     path=$(dirname $0)
>>>...
>>>     ./git.sh: syntax error at line 4: `path=$' unexpected
>>
>>I think $(foo) is required by POSIX.
> 
> 
> 	I believe that Solaris and others (AIX IIRC) have /bin/sh linked
> to /bin/ksh, and it behaves as the POSIX shell when run as /bin/ksh, but
> behaves as a much more true-to-bourne shell when run as /bin/sh.
> 
But "sh" is required to be the POSIX shell (XSH page 850.)

Thus, they might have some braindamage where /usr/bin/sh is the POSIX shell and /bin/sh is a braindead shell. Sigh.

	-hpa
Previous: Joel BeckerNext: Junio C Hamano
Message 13 of 16 in “/bin/sh portability question”
  1. Peter EriksenSep 23, 2005
  2. Junio C HamanoSep 23, 2005
  3. SeanSep 23, 2005
  4. Junio C HamanoSep 23, 2005
  5. SeanSep 23, 2005
  6. Junio C HamanoSep 23, 2005
  7. Peter EriksenSep 23, 2005
  8. Junio C HamanoSep 24, 2005
  9. Patrick MauritzSep 24, 2005
  10. H. Peter AnvinSep 23, 2005
  11. Morten WelinderSep 23, 2005
  12. Joel BeckerSep 23, 2005
  13. H. Peter AnvinSep 23, 2005
  14. Junio C HamanoSep 24, 2005
  15. Nico -telmich- SchotteliusSep 25, 2005
  16. SeanSep 25, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.