ShellNS Types brings a systematization to simulate types in a shell
environment. The package has a series of validators and the documentation above
explains its use and basic concepts.
After downloading the repo project, go to its root directory and use one of the commands below
# Loads the project in the context of the Shell.
# This will download all dependencies if necessary.
. main.sh "run"
# Installs dependencies (this does not activate them).
. main.sh install
# Update dependencies
. main.sh update
# Removes dependencies
. main.sh uninstall
# Runs unit tests, if they exist.
. main.sh utest
# Runs the unit tests and stops them on the first failure that occurs.
. main.sh utest 1
# Export a new 'package.sh' file for use by the project in standalone mode
. main.sh export
# Exports a new 'package.sh'
# Export the manual files.
# Export the 'ns.sh' file.
. main.sh extract-all
To run the project in standalone mode without having to download the repository follow the guidelines below:
# Download with CURL
curl -o "shellns_types_standalone.sh" \
"https://raw.githubusercontent.com/AeonDigital/Shell-ShellNS-Types/refs/heads/main/standalone/package.sh"
# Give execution permissions
chmod +x "shellns_types_standalone.sh"
# Load
. "shellns_types_standalone.sh"
Essentially, Bash variables are character strings, but, depending on context, Bash permits arithmetic operations and comparisons on variables. therefore, to simulate different types, follow the guidelines below.
- Primitive Types
- Date and Time Types
- File System Types
- Objects and Codes
- Return Types
- Special Rules
- Expanding Types
The functions of all ShellNS libraries are decorated with information that can be used by parsers capable of providing filling hints and other features. To learn how to write your own documentation that is compatible with the standard you use, read the following section:
This project uses the MIT License.