unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Tomi Ollila <tomi.ollila@iki.fi>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH v3 1/5] test: use bash specific test for feature tests
Date: Thu, 13 Apr 2023 19:30:51 -0500	[thread overview]
Message-ID: <CAMP44s2O7rV=s841swQMqdewAg1wg_dRAZrHco5SgC96XHjsTQ@mail.gmail.com> (raw)
In-Reply-To: <y2yic7x.cs3jet-too@iki.fi>

On Thu, Apr 13, 2023 at 2:25 PM Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Sun, Apr 09 2023, David Bremner wrote:

> I would just use [ "${VAR-}" = 1 ] in shell script code (or barely
> [[ ${VAR-0} == 1 ]] if desired not to have ""s around variables...but...)
>
> ... using [ "${VAR-}" = 1 ] is also good in a sense that someone may
> use it as an example to write shell scripts with #!/bin/sh as a
> hashbang -- and it works fine on Fedora since there /bin/sh is bash,
> but would fail on Debian since there /bin/sh is dash.

Yeah, the world of shells is a universe, but long story short: you can
just use the above and it should work on all shells and all
configurations.

You can just do "$VAR", *but* it wouldn't work with `set -u`. I never
use -u, so I don't care, but if you do care, do "${VAR-}".

Cheers.

-- 
Felipe Contreras\r

  reply	other threads:[~2023-04-14  0:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-09 14:26 v3 test notmuch as installed David Bremner
2023-04-09 14:26 ` [PATCH v3 1/5] test: use bash specific test for feature tests David Bremner
2023-04-13 12:22   ` Felipe Contreras
2023-04-13 18:56     ` Tomi Ollila
2023-04-13 19:24   ` Tomi Ollila
2023-04-14  0:30     ` Felipe Contreras [this message]
2023-04-09 14:26 ` [PATCH v3 2/5] test: check for empty/missing files in test_expect_equal_message_body David Bremner
2023-04-09 14:26 ` [PATCH v3 3/5] test: Guess a value for NOTMUCH_PYTHON David Bremner
2023-04-09 14:26 ` [PATCH v3 4/5] test: support testing notmuch as installed David Bremner
2023-04-09 14:26 ` [PATCH v3 5/5] debian: add autopkgtests David Bremner

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to='CAMP44s2O7rV=s841swQMqdewAg1wg_dRAZrHco5SgC96XHjsTQ@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).