Date: Mon, 27 Apr 2026 20:31:29 +0200 From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org> To: "Simon J. Gerraty" <sjg@juniper.net> Cc: <src-committers@freebsd.org>, <dev-commits-src-all@freebsd.org>, <dev-commits-src-main@freebsd.org> Subject: Re: git: 566cc005812b - main - safe_set treat ':' and '#' differently Message-ID: <86bjf41chq.fsf@ltc.des.dev> In-Reply-To: <15177.1777314263@kaos.jnpr.net> (Simon J. Gerraty's message of "Mon, 27 Apr 2026 11:24:23 -0700") References: <69e8f964.39869.24418b55@gitrepo.freebsd.org> <86jyts1xzr.fsf@ltc.des.dev> <15177.1777314263@kaos.jnpr.net>
index | next in thread | previous in thread | raw e-mail
"Simon J. Gerraty" <sjg@juniper.net> writes: > Dag-Erling Smørgrav <des@freebsd.org> wrote: > > > Treat '#' as a comment anywhere, > > > but ':' only at start of line. > > > > I can't quite figure out what your goal is with this, but it doesn't > > seem right: `:` is not at all a comment, it is just a built-in alias for > > the `true` command. Among other things, this means that (assuming a > > clean environment) these lines do absolutely nothing: > > Not quite. > I use lines like: > > : tag=$tag > > to aid debugging. Eg: > > for tag in `IFS=,; echo $DEBUG_SH` > do > : tag=$tag > case "$tag" in > > without the : tag=$tag one cannot tell what the value of tag is > in the set -x output. > > The goal here is to ensure a line like that will be ignored. That's beside the point, which is that your regex is incorrect. It will treat e.g. `:foo` as a comment. DES -- Dag-Erling Smørgrav - des@FreeBSD.orghome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86bjf41chq.fsf>
