# DOS-Like Shell (Zig) A small DOS-inspired shell implemented in Zig. It aims to reproduce the feel of classic MS-DOS utilities and behaviors, including 8.3 filename formatting, backslash paths, simple prompts, and a subset of built-in commands. This project is educational and intentionally simplified; it is not a full DOS emulator or a drop-in replacement for CMD. ## Features - DOS-style prompt with basic variables: - `$p` current path (formatted in DOS style) - `$g` greater-than character (`>`) - Path handling: - Converts `/` to `\` and uppercases drive letters and names - Formats individual path segments to 8.3-style names where applicable - Defaults to `C:` when no drive is present - Built-in commands (subset): - `ECHO` (plain and text) - `CLS` - `EXIT` - `VER` - `DATE` and `TIME` (simplified calculations/formatting) - `DIR` (lists files/directories with simplified date/time and sizes) - `TYPE` (prints file contents with basic character handling) - `SORT` (reads from redirected input and prints sorted lines) - `CD`/`CHDIR` (change directory; basic cases like `..` and root) - `COPY` (file copy; also supports `COPY CON destination` for interactive input until Ctrl+Z) - `DEL`/`ERASE` (file removal; no wildcards yet) - `MKDIR`/`MD` (make directory) - Redirection: - Input: `< file` - Output overwrite: `> file` - Output append: `>> file` - External command execution: - Executes programs in your environment when not matched by a built-in ## Limitations - Simplified date/time and calendar calculations - No full wildcard support (e.g., in `DEL`) - Device names (`CON`, `PRN`, `LPTx`) are recognized in limited contexts - Not a complete DOS environment; behavior is “DOS-like” rather than exact ## Build Requirements: - Zig (recent version) Build: ``` zig build ``` This produces an executable in `zig-out/bin`. ## Run Start the shell: ``` zig-out/bin/dose ``` You’ll see a DOS-like prompt. Example interactions: ``` C:\> VER DOSE Version 6.22 C:\> DIR ... directory listing ... C:\> COPY CON hello.txt Hello world! ^Z 1 File(s) copied C:\> TYPE hello.txt Hello world! ``` Redirection: ``` C:\> DIR > dir.txt C:\> TYPE dir.txt ``` Change directory: ``` C:\> CD .. C:\> DIR ``` ## Development Notes - The shell uses a simple parser and a set of built-in command handlers. - Paths shown to the user are normalized to DOS conventions (uppercase, backslashes, and 8.3-style segments). - External commands are executed via the host OS process APIs; errors are reported in a DOS-like manner. ## Roadmap - Wildcards for file operations - More built-in commands and switches - Improved date/time correctness - Better device/file semantics - Enhanced error messages and testing ## License GNU AGPLv3.