msu is a Bash framework promoting modularity and minimality in the command line. One of the major purposes of such a framework is to reduce time (and code) taken to write bash scripts. Since most scripts you will write may have a very short shell life (and I’m a lazy programmer), it is most likely horrifying to have to write and re-write common functions, such as console logging functions, etc.
This will be a quick rundown on how msu works. Read the docs for more in-depth information
It is assumed that you have msu installed
msu revolves around this concept of modules
A module can be seen as a collection of reusable Bash script(s). A module would contain some functions that you want to reuse from script to script. Most modules are aligned towards a narrow goal, such as transfer for file transfers and fancy-aliases for (of course) fancy aliases.
Since we always want to manage our modules, maybe put it up on Github or something, msu always you to install modules from either Github or BitBucket. Yes, you module can be in a private repository. However, only git repositories are supported.
msu has a useful alias,
msu.reload, for reloading aliases in times like
this. So you do not need to restart your terminal, for
msu always ships with some internal modules, which are minimal but powerful. They include formatting and console logging modules.
Here is an example of a simple script using some logging functions from
the internal module
Now let’s make it executable and run it:
The output will be colored appropriately. Other functions in the
module include interactively asking for user input and passwords. Read
the man-pages for documentation on the functions.
There are modules I use frequently. I have placed them in a file:
I just move with this file from machine to machine. To install my
modules, I just use the above file with the sub-command
See demo below
Since you might be interacting with many machines, you may want to install
msu and some modules in a remote machine, then purge them after you are
done. There is a sub-command for that:
See demo below
Now, upgrading! Upgrading most things can be a bitch! But not with msu.
upgrade is made for just this purpose. It upgrades
your installation to the latest release.
msu is still a baby! More code (and coffee, especially) is needed to achieve production-grade status. Why don’t you head over to the Github project page and fork!