#shell #lua-script #bash

app lush

LuSH is a lua for shell scripts - embedded in a single binary, easy to share, to run everywhere

8 releases

new 0.1.7 Oct 6, 2024
0.1.6 Aug 27, 2024
0.1.4 Jul 23, 2024

#789 in Development tools

Download history 266/week @ 2024-06-27 267/week @ 2024-07-04 32/week @ 2024-07-11 101/week @ 2024-07-18 38/week @ 2024-07-25 82/week @ 2024-08-01 6/week @ 2024-08-08 152/week @ 2024-08-22 27/week @ 2024-08-29 5/week @ 2024-09-12 6/week @ 2024-09-19 6/week @ 2024-09-26 133/week @ 2024-10-03

150 downloads per month

Apache-2.0

21KB
498 lines

LuSH

LuSH is a lua for shell scripts - embedded in a single binary, easy to share, to run everywhere

The problem

I love Bash. I have tons of bash scripts, they're run only on my machine. If I copy to other hosts, they never work properly because either the bash version is older or some of the shell utils are not available or are not the same version, etc. Surely there are many methods to solve this, but the scripts complexity just increase. In prative, they never work everywhere.

I want to simplify my life, not the other way around.

The solution

My own solution for that is to be able to deploy, just by copying, all I need to run my scripts. My first idea was to build a portable bash version, but I still need to have many other utils, such as awk, cut, wc, etc. So, why not using a more powerful language? For that, one widely used, easy and that just works is LUA. I love its simplicity and powerful tables.

Initially, where I am, this will be a portable LUA interpreter (without any dependencies, all static) and many lua scripts with helpers to make it easy for the scripts to call local binaries.

Why nots

Why not Python?

Because I really don't like whitespace as block delimiter

Why not Ruby?

Because the runtime is big and not very portable.

Why not (whatever other language)?

Because I had to choose one. I got a super popular language as I don't want to be the eternal father of the project. I want something to solve my issues and not creating more. LUA has tons of scripts to do pretty much anything and most of them I just need to copy a lua file to a directory. Isn't it great?

Installing

Run the script

cargo install lush

Roadmap (so far)

  • List all new lush functions with parameters

Dependencies

~10–20MB
~285K SLoC