See also: Userspace Index, Kernel Syscall
usr/sh contains the shell executable used for interactive command execution and userspace process launching.
Features
-
Built-in commands:
exit [code],cd [dir],help -
Variable assignment:
VAR=valuesyntax -
Variable expansion:
$VARsubstitution in tokens -
PATH lookup: Searches
$PATHfor executables -
I/O redirection:
<(input),>(output),>>(append) -
Pipelines:
|operator with proper fork/exec/pipe plumbing -
Chaining:
&&conditional command execution -
Signal handling: SIGINT is ignored (children handle it)
Implementation
-
755 lines of C (
sh.c) -
Exercises key process and file syscall paths from userspace
-
Acts as the default interactive userspace application
Current Status
The shell is structurally complete. The main() function currently returns 0 (the init/loop functions are commented out), pending integration with the full init process flow.