#utilities #process #specification

app vish

A featureful POSIX-compliant shell that will leave you impressed

2 unstable releases

0.2.0 Mar 22, 2025
0.1.0 Sep 28, 2024

#288 in Unix APIs

Download history 2/week @ 2024-12-04 3/week @ 2024-12-11 116/week @ 2025-03-19

116 downloads per month

ISC license

54KB
1.5K SLoC

Vish

This project aims to create a POSIX-compliant shell, following the specification outlined in:
POSIX Shell and Utilities Specification

Overview

Vish currently supports:

  • Command execution (spawning child processes)
  • Basic built-in utilities (exec, exit, echo, false, true)
  • Prompt customization via $PS1
  • Line editing improvements (Ctrl+A, Ctrl+E, Ctrl+D)
  • Simple parameter expansion ($VAR but not ${VAR:-default} yet)

Work in Progress

  • Control flow syntax (e.g., if, while, for)
  • Full expansion support (handling quotes, arithmetic, command substitution, etc.)
  • More built-in utilities (see the checklists below)
  • Job control (bg, fg, jobs, kill, wait, etc.)
  • Pipelines (cmd1 | cmd2 | cmd3)
  • Command lists (cmd1 && cmd2, cmd1 || cmd2, cmd1; cmd2)
  • Compound commands ({ cmd1; cmd2; }, ( cmd1; cmd2 ))
  • Function definitions (foo() { echo "Hello"; })
  • Signal handling (trap, handling SIGINT, SIGTERM, etc.)
  • Pattern matching (globbing: *.txt, file_[0-9].log)

This now covers all major shell features that need to be implemented. Would you like any refinements or additions?

Implementation Details

Command execution follows the correct order as specified in:
POSIX Shell Execution Order

Unspecified utilities may or may not be implemented.


Special Built-In Utilities

  • break
  • colon
  • continue
  • dot
  • eval
  • exec
  • exit
  • export
  • readonly
  • return
  • set
  • shift
  • times
  • trap
  • unset

Built-In Utilities

  • alias
  • bg
  • cd
  • command
  • echo
  • false
  • fc
  • fg
  • getopts
  • hash
  • jobs
  • kill
  • printf
  • pwd
  • read
  • test
  • true
  • type
  • ulimit
  • umask
  • unalias
  • wait

Dependencies

~315–630KB
~14K SLoC