Skip to content
forked from piranna/P9sh

CLI shell for Plan 9 operating system

Notifications You must be signed in to change notification settings

ChaOS-Project/P9sh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command line shell for Plan 9 operating system compatible with Linux/Unix.

Originally developed as a practice for the Operating Systems course at Rey JuanCarlos University at Spain, my intention is in the future add more features to become it more Unix-user friendly. Think of it more like ash than like rc.

This code can also be found at https://github.com/piranna/P9sh

Table of Contents

Why the name of P9sh?

Well, at a first point because it's focused on Plan 9 (althought it compiles under Linux with Plan9port, and maybe i would do a native Linux/Unix version in the future), but also because P9 sound similar to Piranna :-P

Characteristics

  • Low size
  • Low memory footprint
  • Clean and very legible code
  • Highly modular
  • Full of comments :-D

Features

  • Input buffered
  • Support for built-ins "a-la" BusyBox
    • cd
  • Pipelines
  • Stdin & stdout redirection
  • Commands in background

Optional extensions (for the practice)

  • heredocs (using brackets are identifiers)
  • environment vars (set & expansion)
  • redirection to environment var

Requeriments

  • echo command (needed by heredoc implementation)

Linux/Unix

Plan 9

  • -Nothing- (obviusly... :-D )

Built-ins

A built-in in P9sh is simply a function with a C-main sign, so they are really easy to develop:

  1. copy&paste the original source code of the program to embed somewhere in the P9sh source tree (it's own file it's not a bad idea... :-) )
  2. rename the built-in main function to something different... and meaningful
  3. add an entry for the new built-in at getBuiltin() function
  4. ...et voila! :-D

About

CLI shell for Plan 9 operating system

Resources

Stars

Watchers

Forks

Packages

No packages published