You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bashlets is a new modular extensible toolbox for Bash, written in Bash.
The project is still in its early days, yet it is quite usable and the core features are already there: smart loading of modules, integration with git, partial OO support, and more.
The project has a threefold aim:
bringing together the largest possible corpus of useful pieces of reusable Bash code, with everything organized in as neat a fashion as we can think of
shielding the user from some of the Bash technicalities and idiosyncrasies
writing a consistent and portable API (well, kind of) towards the operating system
I want to stress the fact that this is not a generically-compliant POSIX shell project; on the contrary, the aim of the project is to write code that will run on (and require) Bash. As to the rest of the environment, however, the long-term goal is to get rid of dependencies on external tools as far as it is possible (or reasonable) to do so, even though at present the code does assume a reasonably standard GNU/Linux system.
Rationale
TODO
Contributing
Of course there is so much work to do, and I'd be delighted if somebody is willing to step in with code, enhancements, suggestions, and of course test cases and bug reports!
Requirements
A reasonably sane GNU environment is assumed to be at hand. More specifically, you need:
$ source bashlets core::cache::fs
$ cache=$(bash$$ fs create)
$ # set key/value in a subshell...
$ ( bash$$ fs set $cache question 'To be, or not to be...' )
$ # read value in the parent shell
$ bash$$ fs get $cache question
To be, or not to be...
$ bash$$ fs destroy $cache
Character streams: converting formats without external tools
$ source bashlets core::stream::convert
$ cat << ??? | bash$$ convert unix2dos | file -
> Shall I compare thee to a summer's day?
> Thou art more lovely and more temperate.
> Rough winds do shake the darling buds of May,
> And summer's lease hath all too short a date...
> ???
/dev/stdin: ASCII text, with CRLF line terminators