
On Mon, 30 Oct 2023 08:40:51 +1300, Peter Reutemann quoted:
'The home-brewed project "mixes your native shell with Python with the goal of letting you use your regular shell but also use Python as effectively a shell scripting language, as an alternative to your shell's built-in scripting language...'
Not so sure this is a good idea. The way I see it, there is a fundamental dichotomy between shell/command languages and programming languages (including “scripting” languages). In a shell language, everything you type is assumed to be a literal string, unless you use special substitution sequences. E.g. ls -l thingy “give me information about the file/directory named ‘thingy’”, vs. ls -l $thingy “give me information about the files/directories whose names are in the value of the variable ‘thingy’”. Whereas in a programming language, everything is assumed to be a language construct, and every unadorned name is assumed to reference some value/object, so you need quote marks to demarcate literal strings, e.g. os.listdir(thingy) “return a list of the contents of the directory whose name is in the variable ‘thingy’”, vs. os.listdir("thingy") “return a list of the contents of the directory named ‘thingy’”. The point being that, in regular use, most of the things you type at a shell command line are in fact literal strings, with only occasional use of variables and other substitution constructs; such substitutions happen more commonly in script files. So if you want to use a more programming-oriented language like Python as a command line, then you will end up typing literal quotes a lot more often, which will likely become an annoyance.