Skip to content

x executable file not found in $PATH #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sinawic opened this issue Jan 26, 2025 · 4 comments
Open

x executable file not found in $PATH #142

sinawic opened this issue Jan 26, 2025 · 4 comments

Comments

@sinawic
Copy link

sinawic commented Jan 26, 2025

hi
i am using an externally installed cli tool
let's say figlet in my bash script
and when i compile and export the binary file using bunster
runs without any issue on the machine where i built it
but when i move it to a machine that figlet is not installed
when i run the bin file i get
"figlet": executable file not found in $PATH
i think i might be getting it wrong but shouldn't the built bin file be independent of whatever used in the original bash script?

if the built bin file is also dependent on the tools used in the original script file
then how the final bin file is different from the bash script file?

@yassinebenaid
Copy link
Owner

Good question.

bunster eliminates dependence on the shell, not the command that runs in the script.

The difference between bunster and a shell like bash is that bash interprets the script. This means you need to have bash installed to run the script. bunster compiles the script to a static binary. So, it can run in environment in which shell (bash) is not installed, (just like compiling a C program).

Why would you choose bunster over bash:

  • if you want to run a script in an environment where the shell access is restricted. or where there is no shell installed. For example, a cloud server.

  • bunster offers more than just compilation. In future releases, a standard library will be added to eliminate the need for a lot of frequently used utilities. This means, you won't need an external program to use them.

  • implementation differences:

    • bash runs across multiple processes. for example, pipelines, lists, builtin commands, compound commands, coprocesses, asyncronous commands and many more things run in one or more processes. While in bunster, only external programs run in a sub-process. All other operations are done in same process. in rare cases they might run in a thread. which is much more optimal.
    • in bash: file descriptors are managed at the kernel level. in bunster, file descriptors are managed at the program level. this is why in bash, duplicating a file descriptor above 9 is discouraged. in bunster we don't have this problem, in fact, you can safely do this in bunster: echo foobar 99999999999999>&1 >&99999999999999 .
    • shells in general are known to have a lot of bottlneck with quotes. we will try to improve when certain operations are done to fix this issue.
  • module system, in future releases, you will be able to share scripts and consume them as libraries. just like other languages.

  • binding: in future releases, you will be able to write code in C and Go. and compile it with your script, and be able to use it in your script just like a command. (no external programs are needed)

in addition to a lot of other features to be added.

Don't use bunster:

  • If you have a small script you use at you computer
  • For installation and setup scripts that are shered throughout the internet. For security reasons, those scripts must remain human readable.

@sinawic
Copy link
Author

sinawic commented Jan 26, 2025

thanks for the response
very complete and understanding

best regards

@markrity
Copy link

markrity commented Feb 3, 2025

@sinawic @yassinebenaid what about having an installation of that missing cli tool as a part of bash script. It might be a solution for that issue?

@yassinebenaid
Copy link
Owner

@markrity didn't get it. Do you mean to embed the program within the script. And be able to run it later ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants