List for cgit developers and users
 help / color / mirror / Atom feed
From: nobody at nowhere.ws (Christian Franke)
Subject: [PATCH v2 1/1] syntax-highlight: when the file has no extension,  assume text
Date: Thu, 05 Apr 2012 11:38:47 +0200	[thread overview]
Message-ID: <4F7D6827.80107@nowhere.ws> (raw)
In-Reply-To: <4F7C7FC6.9090402@hupie.com>

On 04/04/2012 07:07 PM, Ferry Huberts wrote:
> On 04-04-12 18:58, Lukas Fleischer wrote:
>> There is no "==" in POSIX shell/test(1). This should probably be a
>> single equal sign ("=").

> it appears there is, or (if there is not) the line above also doesn't
> work (that line has been in since 56522eb, 19-11-2009)

$ cat << EOF > test.sh
if [ "magic" == "\$1" ]; then
    echo "Argument is magic."
fi
EOF
$ /bin/dash test.sh
[: 3: magic: unexpected operator
$ /bin/dash test.sh magic
[: 3: magic: unexpected operator
$ sed -e 's/==/=/' -i test.sh
$ /bin/dash test.sh
$ /bin/dash test.sh magic
Argument is magic.
$ /bin/bash test.sh
$ /bin/bash test.sh magic
Argument is magic.

dash is a posix compatible shell. As most people use bash as their
shell, incompatibilies with posix shell often go unnoticed for a long
time. A script should however either specify /bin/bash as interpreter
or adhere to the shell language given in POSIX.

Best Regards,
Christian




  reply	other threads:[~2012-04-05  9:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 16:15 mailings
2012-04-04 16:58 ` cgit
2012-04-04 17:07   ` mailings
2012-04-05  9:38     ` nobody [this message]
2012-04-05 10:04       ` mailings

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=4F7D6827.80107@nowhere.ws \
    --to=cgit@lists.zx2c4.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).