Modernish
Modernish is a library for writing robust, portable, readable, and powerful programs for POSIX-based shells and utilities.
Install / Use
/learn @modernish/ModernishREADME
modernish – harness the shell
- Sick of quoting hell and split/glob pitfalls?
- Tired of brittle shell scripts going haywire and causing damage?
- Mystified by line noise commands like
[,[[,((? - Is scripting basic things just too hard?
- Ever wish that
findwere a built-in shell loop? - Do you want your script to work on nearly any shell on any Unix-like OS?
Modernish is a library for shell script programming which provides features like safer variable and command expansion, new language constructs for loop iteration, and much more. Modernish programs are shell programs; the new constructs are mixed with shell syntax so that the programmer can take advantage of the best of both.
There is no compiled code to install, as modernish is written entirely in the shell language. It can be deployed in embedded or multi-user systems in which new binary executables may not be introduced for security reasons, and is portable among numerous shell implementations. The installer can also bundle a reduced copy of the library with your scripts, so they can run portably with a known version of modernish without requiring prior installation.
Join us and help breathe some new life into the shell! We are looking for testers, early adopters, and developers to join us. Download the latest release or check out the very latest development code from the master branch. Read through the documentation below. Play with the example scripts and write your own. Try to break the library and send reports of breakage.
Table of contents
- Getting started
- Two basic forms of a modernish program
- Interactive use
- Non-interactive command line use
- Shell capability detection
- Names and identifiers
- Reliable emergency halt
- Low-level shell utilities
- Testing numbers, strings and files
- The stack
- Modules
use safeuse var/loopuse var/localuse var/arithuse var/assignuse var/readfuse var/shellquoteuse var/stackuse var/stringuse var/unexportuse var/genoptparseruse sys/baseuse sys/cmduse sys/diruse sys/term
- Appendix A: List of shell cap IDs
- Appendix B: Regression test suite
- [Difference between capability detection and regressio
