Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jun 2025 12:55:14 +0100
From:      Lexi Winter <ivy@freebsd.org>
To:        Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        Ronald Klop <ronald-lists@klop.ws>, Cy Schubert <cy@freebsd.org>, dev-commits-src-main@freebsd.org, dev-commits-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: git: b6e33f0cd536 - main - rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS
Message-ID:  <aFFXogrkD32X6WVr@freefall.freebsd.org>
In-Reply-To: <20250616023154.3D2B730C@slippy.cwsent.com>
References:  <240137891.21754.1749997280448@localhost> <20250616023154.3D2B730C@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--4IRHxbze8FHauxFp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Cy Schubert:
> In message <240137891.21754.1749997280448@localhost>, Ronald Klop writes:
[...]
> > > +       if [ "$vfstype" =3D "zfs" -a "$a" !=3D "#" ]; then
> >
> > Does this mean that a comment # must always be folllowed by a whitespac=
e?

> Yes. It's a hack but it's the only way without grep (when /usr may not be=
=20
> mounted). In the very worst case rc.d/zpool will be needlessly executed.

could you not check for a comment using the # variable expansion operator?
i.e. if [ "${a#\#}" !=3D "$a" ] then the variable starts with a # character:

$ echo $line1
#Foo bar
$ echo $line2
Foo bar
$ echo $line3
Foo # bar
$ [ "${line1#\#}" =3D "$line1" ] || echo comment
comment
$ [ "${line2#\#}" =3D "$line2" ] || echo comment
$ [ "${line3#\#}" =3D "$line3" ] || echo comment
$

--4IRHxbze8FHauxFp
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaFFXngAKCRD1nT63mIK/
YHSfAP9+GSKp8kTHklHqe1YGaYA7diJK7ZlTOnlco+Oj0Iw1ewD6A7mpT+xhYAHs
HWCcmkrRKa/C3lxhVyqEGMh4+fHHHw8=
=4b11
-----END PGP SIGNATURE-----

--4IRHxbze8FHauxFp--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?aFFXogrkD32X6WVr>