public inbox for goredo-devel@lists.cypherpunks.ru
Atom feed
From: Sergey Matveev <stargrave@stargrave•org>
To: goredo-devel@lists.cypherpunks.ru
Subject: Re: GoRedo shell specification?
Date: Fri, 26 Feb 2021 23:59:18 +0300	[thread overview]
Message-ID: <YDlhMZ7LYPYo5S4E@stargrave.org> (raw)
In-Reply-To: <CAHJSYiS74PdtZCbH=mTKAa7nPdKvmCmwLooHJXQMkA+-kQMsgA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2003 bytes --]

*** Norman Kabir [2021-02-26 14:15]:
>*> executable .do is run as is, non-executable is run with /bin/sh -e[x]*
>What is the motivation for this behavior? It's different from
>apenwarr's implementation.

Several other implementations (not sure, but I remember that actually
the most I saw) also differs from apenwarr and goredo and only execute
(executable) .do files.

I like approach of executable .do-s because it requires literally
nothing from the redo implementation itself -- the kernel does all the
job: parsing shebangs and executing necessary command line. It is
versatile: you can use binary object files, or shebang-ed scripts of any
language you prefer.

But also I believe that most of .do-s are POSIX shell scripts in
practice. And the tool should be convenient and helpful. It is annoying
to keep "#!/bin/sh" in every single .do file. Moreover it is *very*
convenient to have ability to switch on (set -x) trace flag to see what
happens during the .do's invocation. So redo implementation have to have
some way of turning "-x" flag on. And here is convenient suggestion of
keeping .do files shebangless with explicit "-x" control. And you
differentiate "universal" .do files from shebangless ones with
executable permission bit.

Executable .do-s will work everywhere, but you loose ability to control
"-x" flag if it is POSIX shell. Or you may parse the .do and make the
work kernel already does. Non-executable .do-s are just convenient
single use-case. I see no reason of non-executable shebang-ed .do,
because if it is not POSIX shell script, then you can not safely add
"-x" flag to it and its behaviour does not differ from the executable one.

Also there is some critique of apenwarr's .do parsing (I am agreed with)
at the bottom of that page:
http://web.archive.org/web/20201231033027/http://jdebp.eu/FGA/introduction-to-redo.html

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2021-02-26 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 14:05 goredo 1.3.0 release announcement Sergey Matveev
2021-02-26 17:26 ` GoRedo shell specification? Norman Kabir
2021-02-26 17:39   ` spacefrogg-goredo
2021-02-26 20:15   ` Norman Kabir
2021-02-26 20:59     ` Sergey Matveev [this message]