DMOD Shell - A lightweight shell implementation for the DMOD module system.
dmell is a shell interpreter designed for the DMOD (Dynamic Module) system. It provides a command-line interface for executing commands, running scripts, and managing variables.
- Built-in Commands: Basic shell commands like
echo,cd,pwd,set,unset,export, andexit - External Command Modules: Complex commands (
cp,mv,ls,cat,mkdir,touch,head,tail,grep,rm,rmdir,find,which,printf) available as separate DMOD modules - Script Execution: Support for
.dmescript files - Variable Management: Environment variables and shell variables support
- Shebang Support: Execute scripts with custom interpreters
| Command | Description |
|---|---|
echo |
Print arguments to standard output |
cd |
Change current directory |
pwd |
Print current working directory |
set |
Set a shell variable |
export |
Export a variable |
unset |
Unset a variable |
exit |
Exit the shell with optional exit code |
Complex file system commands are implemented as separate DMOD modules for better modularity.
These modules can be installed separately using the dmf-get package manager tool:
dmf-get cp
dmf-get mv
dmf-get ls
dmf-get cat
dmf-get mkdir
dmf-get touch
dmf-get head
dmf-get tail
dmf-get grep
dmf-get rm
dmf-get rmdir
dmf-get find
dmf-get which
dmf-get printf| Module | Description | Documentation |
|---|---|---|
cp |
Copy files | commands/cp/README.md |
mv |
Move/rename files | commands/mv/README.md |
ls |
List directory contents | commands/ls/README.md |
cat |
Display file contents | commands/cat/README.md |
mkdir |
Create directories | commands/mkdir/README.md |
touch |
Create empty files / update mtime | commands/touch/README.md |
head |
Display first lines of file | commands/head/README.md |
tail |
Display last lines of file | commands/tail/README.md |
grep |
Search text in files | commands/grep/README.md |
rm |
Remove files | commands/rm/README.md |
rmdir |
Remove empty directories | commands/rmdir/README.md |
find |
Search for files | commands/find/README.md |
which |
Locate module path | commands/which/README.md |
printf |
Format and print text | commands/printf/README.md |
- CMake 3.18 or higher
- A C compiler (GCC, Clang, etc.)
- DMOD SDK
mkdir -p build
cd build
cmake ..
cmake --build .On PC, dmell modules are executed using the dmod_loader tool from the DMOD repository:
dmod_loader dmell.dmfFor more details about the loader, see the dmod repository.
dmod_loader dmell.dmf script.dme#!/bin/dmell
echo "Hello, dmell!"
set myvar=value
echo "myvar = $myvar"dmell/
├── src/ # Main shell source files
├── include/ # Header files
├── commands/ # Command modules
│ ├── cp/ # Copy command module
│ ├── mv/ # Move command module
│ ├── ls/ # List command module
│ ├── cat/ # Cat command module
│ ├── mkdir/ # Create directory module
│ ├── touch/ # Create empty file module
│ ├── head/ # Display first lines module
│ ├── tail/ # Display last lines module
│ ├── grep/ # Search text module
│ ├── rm/ # Remove files module
│ ├── rmdir/ # Remove directories module
│ ├── find/ # Search for files module
│ ├── which/ # Locate module module
│ └── printf/ # Format and print module
├── examples/ # Example scripts
└── CMakeLists.txt # Build configuration
See LICENSE for details.