Bug#922423: initscripts: formatting of scripts

Marc Chantreux mc at unistra.fr
Wed Mar 19 16:12:29 GMT 2025


hello,

On Wed, Mar 19, 2025 at 04:43:06PM +0100, Thorsten Glaser wrote:
> … or ;|
> 
> (both ;& and ;| fall through, but one unconditionally, the other
> re-evaluates)

yes. it was an example just to tell that exposing the seaprator matters.

> They are relevant only if that branch was already taken.
> Prefixing, like you did in your example, only makes the patterns
> less legible, which are the more important thing.

because your habits tells you so. the way I see it is just the way you
see if, else, elif, fi. it prefixes and still, you have to problem to
find the test.

I used all the other coding styles by mimicry for decades until I came
to this coding style and frankly, it makes things more readable.

> >case "${1}"
> You don’t need the braces nor the quotes: the argument of case
> is always evaluated in scalar context and thus never IFS-split
> or anything.

the braces are here because it's a vim template. I didn't give details
but the cursor appears just after the "1" so I can decide the expansion
to use (? or :- post ).

I wasn't aware shell has a scalar context the way perl does. this is
cool. it avoids not only IFS splitting but also glob expansion.

many thanks for that!

> Getting OT but you might be interested in:
> https://evolvis.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=shellsnippets/shellsnippets.git;a=tree

I'll give a look. thanks again.

> -- 
> FWIW, I'm quite impressed with mksh interactively. I thought it was much
> *much* more bare bones. But it turns out it beats the living hell out of
> ksh93 in that respect. I'd even consider it for my daily use if I hadn't
> wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh 

wow … if it wasn't *that* off topic, I would have shared 'bout that. Anyway …

regards

-- 
Marc Chantreux



More information about the Debian-init-diversity mailing list