All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Peter Eriksen <s022018@student.dtu.dk>
Cc: git@vger.kernel.org
Subject: Re: /bin/sh portability question
Date: Fri, 23 Sep 2005 12:48:39 -0700	[thread overview]
Message-ID: <43345C17.7060402@zytor.com> (raw)
In-Reply-To: <20050923075058.GA25473@bohr.gbar.dtu.dk>

Peter Eriksen wrote:
> 
> 2) In many of the shell scripts there is the idiom:
> 
>       #!/bin/sh
>       
>       cmd=
>       path=$(dirname $0)
>       case "$#" in
>       0)      ;;
>       *)      cmd="$1"
>               shift
>  
>    When run, this gives the error:
> 
>       ./git.sh: syntax error at line 4: `path=$' unexpected
> 
>    I think it's because (on my Solaris at least), sh is really 
>    sh and is not symlinked to bash, and sh doesn't like that 
>    syntax.  Are there any good solutions to this other than
>    making the administrators actually change sh to a symlink,
>    (which I tried)?
> 

I think $(foo) is required by POSIX.

	-hpa

  parent reply	other threads:[~2005-09-23 19:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-23  7:50 /bin/sh portability question Peter Eriksen
2005-09-23  8:24 ` Junio C Hamano
2005-09-23  9:02   ` Sean
2005-09-23  9:02     ` Sean
2005-09-23  9:19       ` Junio C Hamano
2005-09-23 10:34         ` Sean
2005-09-23 10:34           ` Sean
2005-09-25 19:26           ` Nico -telmich- Schottelius
2005-09-25 19:36             ` Sean
2005-09-25 19:36               ` Sean
2005-09-23  9:07 ` Junio C Hamano
2005-09-23 12:17   ` Peter Eriksen
2005-09-24  1:13     ` Junio C Hamano
     [not found]       ` <20050924195029.GA20514@bohr.gbar.dtu.dk>
2005-09-24 21:31         ` Junio C Hamano
2005-09-24 17:35   ` Patrick Mauritz
2005-09-23 19:48 ` H. Peter Anvin [this message]
2005-09-23 19:55   ` Morten Welinder
2005-09-23 19:57   ` Joel Becker
2005-09-23 20:00     ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43345C17.7060402@zytor.com \
    --to=hpa@zytor.com \
    --cc=git@vger.kernel.org \
    --cc=s022018@student.dtu.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.