top | item 42805620

(no title)

Phlogistique | 1 year ago

The README fails to address the elephant in the room, which is that usually shell scripts mainly call external commands; as far as I can tell there is no documentation of which built-ins are supported?

That said, in a similar vein, you could probably create a bundler that takes a shell script and bundles it with busybox to create a static program.

discuss

order

mkesper|1 year ago

Busybox commands often don't support all features used to and differ even substantially if you depend on GNU additions. https://www.busybox.net/about.html

1vuio0pswjnm7|1 year ago

I have been keeping a running list of busybox/toybox deficiencies and differences. There are more than I would have expected.

An alternative is to use crunchgen from NetBSD (also included with some of the later BSDs) which crunches full-featured, source tree versions of multiple utilities in a single, static binary. What busybox refers to as a "multi-call" binary.

It will be larger than busybox of course. I get evertyhing I need in a binary less than 5M.

nodesocket|1 year ago

I also wondered this as well. How is something like "cat file.json | jq '.filename' | grep out.txt" implement into Go?

beepbooptheory|1 year ago

I haven't looked at the code, but I assume this is just taking care of things like pipes, loops, variables, conditionals, etc, and leaving the actual binaries like jq as stubs assumed to be there. Its abstracting the shell, not the programs you run in the shell.

zamalek|1 year ago

I assume this is what they are talking about here:

> Standard library: we aim to add first-class support for a variety of frequently used/needed commands as builtins. you no longer need external programs to use them.

That's not going to be an easy task, and would basically entail porting those commands to go.

hezag|1 year ago

Disclamer: the elephant in the room has nothing to do with ElePHPant, the PHP mascot.